def test_errors_on_gifsicle_should_raises_errors(self): engine = Engine(self.context) with open(join(STORAGE_PATH, 'animated.gif'), 'r') as im: buffer = im.read() engine.load(buffer, '.gif') with expect.error_to_happen( GifSicleError, message='gifsicle command returned errorlevel 1 for command' ' "{0} --some-invalid-opt /foo/' 'bar.gif" (image maybe corrupted?)'.format( self.server.gifsicle_path)): engine.run_gifsicle('--some-invalid-opt')
def test_errors_on_gifsicle_should_raises_errors(self): engine = Engine(self.context) with open(join(STORAGE_PATH, "animated.gif"), "r") as im: buffer = im.read() engine.load(buffer, ".gif") with expect.error_to_happen( GifSicleError, message="gifsicle command returned errorlevel 1 for command" ' "{0} --some-invalid-opt /foo/' 'bar.gif" (image maybe corrupted?)'.format(self.server.gifsicle_path), ): engine.run_gifsicle("--some-invalid-opt")
def test_errors_on_gifsicle_should_not_raises_errors_when_output(self): engine = Engine(self.context) with open(join(STORAGE_PATH, 'SmallFullColourGIF.gif'), 'rb') as im: buffer = im.read() engine.load(buffer, '.gif') result = engine.run_gifsicle('--some-invalid-opt') expect(result).Not.to_be_null()
def test_errors_on_gifsicle_should_not_raises_errors_when_output(self): engine = Engine(self.context) with open(join(STORAGE_PATH, 'SmallFullColourGIF.gif'), 'r') as im: buffer = im.read() engine.load(buffer, '.gif') result = engine.run_gifsicle('--some-invalid-opt') expect(result).Not.to_be_null()
def test_errors_on_gifsicle_should_not_raises_errors_when_output(self): engine = Engine(self.context) with open(join(STORAGE_PATH, "SmallFullColourGIF.gif"), "rb") as image_file: buffer = image_file.read() engine.load(buffer, ".gif") result = engine.run_gifsicle("--some-invalid-opt") expect(result).Not.to_be_null()