def test_segment_difference(): s1 = Segment([[0, 10], [20, 30], [50, 100]]) s2 = Segment([[4, 6], [15, 25], [40, 200]]) s1.difference(s2) np.testing.assert_equal( s1._data, np.array([[0, 4], [6, 10], [15, 20], [25, 30], [40, 50], [100, 200]]))
def test_segment_difference_2(): s1 = Segment([[0, 10], [20, 30], [50, 100]]) s2 = Segment([[4, 6], [15, 25], [40, 200]]) s3 = Segment([[8, 20], [35, 60], [150, 180]]) nose.tools.assert_equal(s1 ^ s2 ^ s3, s1.difference(s2, s3))