def test_with_touching_interval(self): point1 = (1, 5) point2 = (5, 8) interval1 = Interval(*point1) interval2 = Interval(*point2) self.assertFalse(is_overlap_internal(interval1, interval2))
def test_with_points_that_are_subset(self): point1 = (1, 5) point2 = (0, 6) interval1 = Interval(*point1) interval2 = Interval(*point2) self.assertTrue(is_overlap_internal(interval1, interval2))
def test_with_negative_points_with_no_overlap(self): point1 = (-1, -5) point2 = (-6, 8) interval1 = Interval(*point1) interval2 = Interval(*point2) self.assertTrue(is_overlap_internal(interval1, interval2))
def test_with_overlap_in_opposite_direction(self): point1 = (-1, -5) point2 = (-2, 6) interval1 = Interval(*point1) interval2 = Interval(*point2) self.assertTrue(is_overlap_internal(interval1, interval2))
def test_with_points_reverse_order(self): point1 = (2, 6) point2 = (1, 5) interval1 = Interval(*point1) interval2 = Interval(*point2) self.assertTrue(is_overlap_internal(interval1, interval2))
def test_with_possible_overlap(self): point1 = (1, 5) point2 = (2, 6) interval1 = Interval(*point1) interval2 = Interval(*point2) self.assertTrue(is_overlap_internal(interval1, interval2))