def test_region_combine_combined(): """Check multiple calls to region_combine""" r1 = 'circle(10,10,10)' r2 = 'rect(100,100,200,200)' r3 = 'ellipse(70,70,10,12,45)' rcomb = Region(r1).combine(Region(r2)) rcomb = rcomb.combine(Region(r3)) r2 = r2.replace('rect', 'rectangle') expected = '&'.join([x.capitalize() for x in [r1, r2, r3]]) assert expected == str(rcomb)
def test_region_ignore_combined(): """Check multiple calls to region_combine I am not sure I agree with the result but I just want to check the results. """ r1 = 'circle(10,10,10)' r2 = 'rect(100,100,200,200)' r3 = 'ellipse(70,70,10,12,45)' rcomb = Region(r1).combine(Region(r2), True) rcomb = rcomb.combine(Region(r3)) r2 = '!' + r2.replace('rect', 'rectangle').capitalize() expected = '&'.join([r1.capitalize(), r2, r3.capitalize()]) assert expected == str(rcomb)
def test_region_ignore_nothing1(): """Ignoring a region frm nothing == !region""" empty = Region() r = empty.combine(Region(region_string), True) assert '!' + normalized_string == str(r)
def test_region_combine_nothing2(ignore): """Adding or ignoring nothing to a region == region""" orig = Region(region_string) r = orig.combine(Region(), ignore) assert normalized_string == str(r)
def test_region_combine_nothing1(): """Adding a region to nothing == region""" empty = Region() r = empty.combine(Region(region_string)) assert normalized_string == str(r)