Simple test, sample data generation script and more
Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
parent
0d1ea25dd1
commit
97f11ab719
12
.coveragerc
Normal file
12
.coveragerc
Normal file
|
@ -0,0 +1,12 @@
|
|||
[run]
|
||||
omit =
|
||||
tests/*
|
||||
|
||||
|
||||
|
||||
[report]
|
||||
exclude_lines =
|
||||
if __name__ == .__main__.:
|
||||
except ModuleNotFoundError:
|
||||
|
||||
|
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -1,3 +1,9 @@
|
|||
*.swp
|
||||
.idea/workspace.xml
|
||||
venv/
|
||||
dvenv/
|
||||
.idea/workspace.xml
|
||||
__pycache__/
|
||||
.coverage
|
||||
build/
|
||||
dist/
|
||||
htmlcov/
|
||||
|
|
|
@ -30,9 +30,6 @@ wraperr pip install -r requirements.txt
|
|||
status "Installing dev dependencies"
|
||||
wraperr pip install -r requirements.dev.txt
|
||||
|
||||
# TODO: fix later
|
||||
exit 0
|
||||
|
||||
status "Preparing data trees for tests..."
|
||||
wraperr bash -c "cd tests/_support_data; ./gen-data.sh"
|
||||
|
||||
|
|
2
tests/_support_data/gen-data.sh
Executable file
2
tests/_support_data/gen-data.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
echo TODO: add some support data
|
24
tests/test_abcd.py
Normal file
24
tests/test_abcd.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
import unittest
|
||||
|
||||
|
||||
class TestStringMethods(unittest.TestCase):
|
||||
|
||||
def test_upper(self):
|
||||
self.assertEqual('foo'.upper(), 'FOO')
|
||||
|
||||
def test_isupper(self):
|
||||
self.assertTrue('FOO'.isupper())
|
||||
self.assertFalse('Foo'.isupper())
|
||||
|
||||
def test_split(self):
|
||||
s = 'hello world'
|
||||
self.assertEqual(s.split(), ['hello', 'world'])
|
||||
# check that s.split fails when the separator is not a string
|
||||
with self.assertRaises(TypeError):
|
||||
s.split(2)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
Reference in New Issue
Block a user