Example #1
0
    def test_overhang_right_diff(self):
        s1 = Span(20, 80, 100, True)
        s2 = Span(70, 90, 100, True)
        diff = s1.differences(s2)
        assert len(diff) == 1
        assert diff[0].a == 20
        assert diff[0].b == 70

        diff = s2.differences(s1)
        print(diff)
        assert len(diff) == 1
        assert diff[0].a == 80
        assert diff[0].b == 90
Example #2
0
    def test_overhang_left_diff(self):
        s1 = Span(20, 80, 100, True)
        s2 = Span(10, 30, 100, True)

        diff = s1.differences(s2)
        assert len(diff) == 1
        assert diff[0].a == 30
        assert diff[0].b == 80

        diff = s2.differences(s1)
        print(diff)
        assert len(diff) == 1
        assert diff[0].a == 10
        assert diff[0].b == 20
Example #3
0
 def test_no_overlap_diff(self):
     s1 = Span(20, 80, 100, True)
     s2 = Span(90, 95, 100, True)
     diff = s1.differences(s2)
     assert len(diff) == 1
     assert s1.a == 20
     assert s1.b == 80
Example #4
0
    def test_linear_diff(self):

        s1 = Span(20, 80, 100, True)
        s2 = Span(30, 50, 100, True)

        diff = s1.differences(s2)
        assert len(diff) == 2
        assert diff[0].a == 20
        assert diff[0].b == 30
        assert diff[1].a == 50
        assert diff[1].b == 80