from unittest.case import TestCase from tudelft.utilities.tools.comparator import DefaultComparator class comparatorTest(TestCase): def testSimple(self): c=DefaultComparator() self.assertEqual(0, c.compare(1, 1)) self.assertEqual(1, c.compare(2, 1)) self.assertEqual(1, c.compare(11, -1)) self.assertEqual(0, c.compare('a', 'a')) self.assertEqual(0, c.compare("a", "a")) self.assertEqual(-1, c.compare("a", "b")) self.assertEqual(-1, c.compare("a", "aha")) self.assertEqual(-1, c.compare(11, 12))