def test_crop_location_on_rectangle(): random_rect = ones([300,200]) random_rect = random_rect>0 a = int(rand()*300) b = int(rand()*(300-(a+1)))+a+1 c = int(rand()*200) d = int(rand()*(200-(c+1)))+c+1 print [a,b,c,d] random_rect[a:b,c:d] = False res = crop(random_rect) assert res[1]==[a,b,c,d]
def test_crop_location_on_rectangle(): random_rect = ones([300, 200]) random_rect = random_rect > 0 a = int(rand() * 300) b = int(rand() * (300 - (a + 1))) + a + 1 c = int(rand() * 200) d = int(rand() * (200 - (c + 1))) + c + 1 print[a, b, c, d] random_rect[a:b, c:d] = False res = crop(random_rect) assert res[1] == [a, b, c, d]
def test_crop_location_on_rect(): res = crop(rect) assert res[1]==[50,120,50,130]
def test_crop_size_on_rect_with_padding(): res = crop(rect,4) assert sum(res[0])==1264
def test_crop_size_on_circle(): res = crop(circle) assert sum(res[0])==2029
def test_crop_size_on_rect(): res = crop(rect) assert sum(res[0])==0
def test_crop_location_on_rect(): res = crop(rect) assert res[1] == [50, 120, 50, 130]
def test_crop_size_on_rect_with_padding(): res = crop(rect, 4) assert sum(res[0]) == 1264
def test_crop_size_on_circle(): res = crop(circle) assert sum(res[0]) == 2029
def test_crop_size_on_rect(): res = crop(rect) assert sum(res[0]) == 0