|
|
@@ -177,6 +177,14 @@ class TestInterval(unittest.TestCase): |
|
|
|
self.assertTrue(interval3 > interval2) # interval3 start is larger |
|
|
|
self.assertTrue(interval3 < interval4) # same start, interval3 has smaller end |
|
|
|
|
|
|
|
def test_eq(self): |
|
|
|
"""Test the __eq__ method for comparing Interval objects""" |
|
|
|
interval1 = utils.Interval(start=0, end=10) |
|
|
|
interval2 = utils.Interval(start=0, end=10) |
|
|
|
interval3 = utils.Interval(start=0, end=15) |
|
|
|
self.assertEqual(interval1, interval2) |
|
|
|
self.assertNotEqual(interval1, interval3) |
|
|
|
|
|
|
|
def test_to_json(self): |
|
|
|
"""Test to_json method""" |
|
|
|
interval = utils.Interval(start=self.start, end=self.end) |
|
|
|