def test_intersection(self): interval_list = [Interval(1, 10), Interval(5, 7), Interval(7)] assert Interval.intersection(*interval_list) == Interval(7) interval_list.append(Interval(11)) assert Interval.intersection(*interval_list) is None with pytest.raises(AttributeError): Interval.intersection()
def test_intersection(self): interval_list = [Interval(1, 10), Interval(5, 7), Interval(7)] self.assertEqual(Interval(7), Interval.intersection(*interval_list)) interval_list.append(Interval(11)) self.assertEqual(None, Interval.intersection(*interval_list)) with self.assertRaises(AttributeError): Interval.intersection()