def test_non_equality(): small, medium = get_intervals()[:2] assert small != medium assert small != i.openclosed(1, 5) assert small != i.closedopen(1, 5) assert small != i.closed(1, 5) assert small != i.Interval(i.Interval.OPEN, 1, 7, i.Interval.OPEN) assert small != i.open(100, 288)
def test_closedopen_interval_construction(): expected_lower = i.Interval.CLOSED expectedlower_value = 10 expected_upper_value = 100 expected_upper = i.Interval.OPEN result = i.Interval(i.Interval.CLOSED, 10, 100, i.Interval.OPEN) assert result._lower == expected_lower assert result.lower_value == expectedlower_value assert result._upper_value == expected_upper_value assert result._upper == expected_upper
def test_equality(): small = get_intervals()[0] assert small == small assert small == i.open(1, 5) assert small == i.Interval(i.Interval.OPEN, 1, 5, i.Interval.OPEN)