Ejemplo n.º 1
0
    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')
Ejemplo n.º 2
0
    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")
Ejemplo n.º 3
0
    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()
Ejemplo n.º 4
0
    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()
Ejemplo n.º 5
0
    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()