def test_process_image(tmpdir): "Test the process_image function." status = process_image('foo.txt', 'none.txt', {}) assert status == Status.FAILURE settings = create_settings(img_processor='ResizeToFill', make_thumbs=False) status = process_image(SRCFILE, str(tmpdir), settings) assert status == Status.SUCCESS im = Image.open(os.path.join(str(tmpdir), TEST_IMAGE)) assert im.size == settings['img_size']
def test_process_image(tmpdir): "Test the process_image function." status = process_image('foo.txt', 'none.txt', {}) assert status == Status.FAILURE settings = create_settings(img_processor='ResizeToFill', make_thumbs=False) status = process_image(SRCFILE, str(tmpdir), settings) assert status == Status.SUCCESS im = Image.open(os.path.join(str(tmpdir), TEST_IMAGE)) assert im.size == settings['img_size']
def test_process_image(tmpdir): "Test the process_image function." status = process_image(Image('foo.txt', 'bar', create_settings())) assert status == Status.FAILURE settings = create_settings( img_processor='ResizeToFill', make_thumbs=False, source=os.path.join(SRCDIR, 'dir2'), destination=str(tmpdir), ) image = Image(TEST_IMAGE, '.', settings) status = process_image(image) assert status == Status.SUCCESS im = PILImage.open(os.path.join(str(tmpdir), TEST_IMAGE)) assert im.size == settings['img_size']