Esempio n. 1
0
def test_window_intersection_disjunct():
    with pytest.raises(ValueError):
        window_intersection([
            ((0, 6), (3, 6)),
            ((100, 200), (0, 12)),
            ((7, 12), (7, 12))
        ])
Esempio n. 2
0
def test_window_intersection():
    assert window_intersection([((0, 6), (3, 6)),
                                ((2, 4), (1, 5))]) == ((2, 4), (3, 5))

    assert window_intersection([((0, 6), (3, 6)),
                                ((6, 10), (1, 5))]) == ((6, 6), (3, 5))

    assert window_intersection([((0, 6), (3, 6)), ((2, 4), (1, 5)),
                                ((3, 6), (0, 6))]) == ((3, 4), (3, 5))
Esempio n. 3
0
def test_window_intersection():
    assert window_intersection([
        ((0, 6), (3, 6)),
        ((2, 4), (1, 5))
    ]) == ((2, 4), (3, 5))

    assert window_intersection([
        ((0, 6), (3, 6)),
        ((6, 10), (1, 5))
    ]) == ((6, 6), (3, 5))

    assert window_intersection([
        ((0, 6), (3, 6)),
        ((2, 4), (1, 5)),
        ((3, 6), (0, 6))
    ]) == ((3, 4), (3, 5))
Esempio n. 4
0
def test_window_intersection(recwarn):
    data = [((0, 6), (3, 6)), ((2, 4), (1, 5))]
    warnings.simplefilter('always')
    old = window_intersection(data)
    assert len(recwarn) == 1
    assert recwarn.pop(DeprecationWarning)
    new = windows.intersection(data)
    assert len(recwarn) == 0
    assert old == new
Esempio n. 5
0
def test_window_intersection(recwarn):
    data = [
        ((0, 6), (3, 6)),
        ((2, 4), (1, 5))]
    warnings.simplefilter('always')
    old = window_intersection(data)
    assert len(recwarn) == 1
    assert recwarn.pop(DeprecationWarning)
    new = windows.intersection(data)
    assert len(recwarn) == 0
    assert old == new
Esempio n. 6
0
def test_window_intersection_disjunct():
    with pytest.raises(ValueError):
        window_intersection([((0, 6), (3, 6)), ((100, 200), (0, 12)),
                             ((7, 12), (7, 12))])