Example #1
0
def test_inside(patch_corners):
    c1 = ({'x': 10, 'y': 10}, {'x': 20, 'y': 10},
          {'x': 10, 'y': 20}, {'x': 20, 'y': 20})
    c2 = ({'x': 15, 'y': 15}, {'x': 18, 'y': 15},
          {'x': 15, 'y': 18}, {'x': 18, 'y': 18})
    patch_corners.side_effect = [c1, c2]
    assert _overlap(None, None)
Example #2
0
def test_no_overlap(patch_corners):
    c1 = ({'x': 10, 'y': 10}, {'x': 20, 'y': 10},
          {'x': 10, 'y': 20}, {'x': 20, 'y': 20})
    c2 = ({'x': 30, 'y': 30}, {'x': 40, 'y': 30},
          {'x': 30, 'y': 40}, {'x': 40, 'y': 40})
    patch_corners.side_effect = [c1, c2]
    assert not _overlap(None, None)