def test__crop_image_args(mock_Image) -> None: image = mock_Image() bie._crop_image(image, left='left', right='right', top='top', bottom='bottom', extra=10) assert image.crop.call_count == 1 assert image.crop.call_args[0] == (('left', 'top', 'right', 'bottom'), ) assert image.crop.call_args[1] == {}
def test__crop_image(): image = Image.new(mode="RGBA", size=(10, 10)) rect = dict(left=2, right=8, top=3, bottom=7) cropped = bie._crop_image(image, **rect) assert cropped.size == (6, 4)
def test__crop_image(): image = Image.new(mode="RGBA", size=(10,10)) rect = dict(left=2, right=8, top=3, bottom=7) cropped = bie._crop_image(image, **rect) assert cropped.size == (6,4)
def test__crop_image_args(mock_Image): image = mock_Image() bie._crop_image(image, left='left', right='right', top='top', bottom='bottom', extra=10) assert image.crop.call_count == 1 assert image.crop.call_args[0] == (('left', 'top', 'right', 'bottom'), ) assert image.crop.call_args[1] == {}