From 13d2507d605ca418dfe8abbb63f5de69cd8a6bec Mon Sep 17 00:00:00 2001 From: jvoisin Date: Tue, 6 Mar 2018 23:20:18 +0100 Subject: First commit --- tests/main.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/main.py (limited to 'tests/main.py') 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 @@ +#!/usr/bin/python3 + +import unittest + +class TestCleaning(unittest.TestCase): + def test_pdf(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() -- cgit v1.3