def test_connecting_span_cyclic(): s1 = Span(10, 20, 100, True) s2 = Span(80, 90, 100, True) s3 = s1.connecting_span(s2) assert s3.a == 20 assert s3.b == 80 s4 = s2.connecting_span(s1) assert s4.a == 90 assert s4.b == 10
def test_connectin_span_consecurive_is_empty(): s1 = Span(10, 30, 100, True) s2 = Span(30, 50, 100, True) assert not s1.overlaps_with(s2) s3 = s1.connecting_span(s2) assert len(s3) == 0
def test_connectin_span_over_origin(): s1 = Span(50, 60, 100, True) s2 = Span(5, 30, 100, True) s3 = s1.connecting_span(s2) assert s3.a == 60 assert s3.b == 5
def test_connecting_span_linear_no_span(): s1 = Span(10, 99, 100, False) s2 = Span(0, 10, 100, False) s3 = s1.connecting_span(s2) assert s3 is None
def test_connectin_span_with_overlap(): s1 = Span(10, 30, 100, True) s2 = Span(20, 50, 100, True) assert not s1.connecting_span(s2)
def test_self_connecting_span(): s1 = Span(50, 60, 100, True) s2 = s1.connecting_span(s1) assert s2.a == 60 assert s2.b == 50
def test_connecting_span(): s1 = Span(20, 50, 100, False) s2 = Span(60, 75, 100, False) s3 = s1.connecting_span(s2) assert s3.a == 50 assert s3.b == 60