diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/data/dirty.pdf | bin | 0 -> 543475 bytes | |||
| -rw-r--r-- | tests/main.py | 22 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/data/dirty.pdf b/tests/data/dirty.pdf new file mode 100644 index 0000000..0d88779 --- /dev/null +++ b/tests/data/dirty.pdf | |||
| Binary files differ | |||
diff --git a/tests/main.py b/tests/main.py new file mode 100644 index 0000000..52828af --- /dev/null +++ b/tests/main.py | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | #!/usr/bin/python3 | ||
| 2 | |||
| 3 | import unittest | ||
| 4 | |||
| 5 | class TestCleaning(unittest.TestCase): | ||
| 6 | def test_pdf(self): | ||
| 7 | self.assertEqual('foo'.upper(), 'FOO') | ||
| 8 | |||
| 9 | def test_isupper(self): | ||
| 10 | self.assertTrue('FOO'.isupper()) | ||
| 11 | self.assertFalse('Foo'.isupper()) | ||
| 12 | |||
| 13 | def test_split(self): | ||
| 14 | s = 'hello world' | ||
| 15 | self.assertEqual(s.split(), ['hello', 'world']) | ||
| 16 | # check that s.split fails when the separator is not a string | ||
| 17 | with self.assertRaises(TypeError): | ||
| 18 | s.split(2) | ||
| 19 | |||
| 20 | |||
| 21 | if __name__ == '__main__': | ||
| 22 | unittest.main() | ||
