def test_partition():
    ds = Interval(1, 3).partition([2])
    assert (list(map(tuple, ds)) == [(1, 2), (2, 3)])
    assert (not ds[0].start_open)
    assert ds[0].end_open
    assert (not ds[1].start_open)
    assert (not ds[1].end_open)
    ds = Interval(0, 3).partition([0, 1, 2, 3, 4], start_open=True)
    assert (list(map(tuple, ds)) == [(0, 0), (0, 1), (1, 2), (2, 3)])
    assert (not ds[0].start_open)
    assert (not ds[0].end_open)
    assert ds[1].start_open
    assert (not ds[1].end_open)
    ds = Interval(0, 3).partition([0, 1, 2, 3, 4], start_open=False)
    assert (list(map(tuple, ds)) == [(0, 1), (1, 2), (2, 3), (3, 3)])
    assert (not ds[0].start_open)
    assert ds[0].end_open
    assert (not ds[1].start_open)
    assert ds[1].end_open
def test_partition():
    ds = Interval(1, 3).partition([2])
    assert (list(map(tuple, ds)) == [(1, 2), (2, 3)])
    assert (not ds[0].start_open)
    assert ds[0].end_open
    assert (not ds[1].start_open)
    assert (not ds[1].end_open)
    ds = Interval(0, 3).partition([0, 1, 2, 3, 4], start_open=True)
    assert (list(map(tuple, ds)) == [(0, 0), (0, 1), (1, 2), (2, 3)])
    assert (not ds[0].start_open)
    assert (not ds[0].end_open)
    assert ds[1].start_open
    assert (not ds[1].end_open)
    ds = Interval(0, 3).partition([0, 1, 2, 3, 4], start_open=False)
    assert (list(map(tuple, ds)) == [(0, 1), (1, 2), (2, 3), (3, 3)])
    assert (not ds[0].start_open)
    assert ds[0].end_open
    assert (not ds[1].start_open)
    assert ds[1].end_open