Exemplo n.º 1
0
def test_ends_overlap_with_raise_region_error():
    """This test should raise an error since the contexts are different"""
    with pytest.raises(RegionError):
        r = Region(10, 50, context=Context(100, False, start_index=0))
        r2 = Region(20, 90, context=Context(100, True, start_index=0))
        r.end_overlaps_with(r2)

    with pytest.raises(RegionError):
        r = Region(10, 50, context=Context(100, False, start_index=0))
        r2 = Region(20, 90, context=Context(100, False, start_index=1))
        r.end_overlaps_with(r2)
Exemplo n.º 2
0
def test_ends_overlap_with_reverse_regions():
    """This tests ends overlaps with reverse regions"""
    r = Region(50,
               10,
               direction=Region.REVERSE,
               context=Context(100, False, start_index=0))
    r2 = Region(90,
                20,
                direction=Region.REVERSE,
                context=Context(100, False, start_index=0))
    assert r.end_overlaps_with(r2)
    assert not r2.end_overlaps_with(r)
Exemplo n.º 3
0
def test_ends_overlap_with_circular_context():
    """This tests handling of circular context with end overlaps"""
    r = Region(90, 10, context=Context(100, True, start_index=2))
    r2 = Region(5, 20, context=Context(100, True, start_index=2))
    assert r.end_overlaps_with(r2)
    assert not r2.end_overlaps_with(r)
Exemplo n.º 4
0
def test_ends_overlaps_with():
    r = Region(10, 50, context=Context(100, False, start_index=0))
    r2 = Region(20, 90, context=Context(100, False, start_index=0))
    assert r.end_overlaps_with(r2)
    assert not r2.end_overlaps_with(r)