예제 #1
0
    def test_loads_image_from_result_storage(self):
        self.context.request = Mock(accepts_webp=False)
        expected_path = self.result_storage.normalize_path("HPbIwc4ACNupMwcOQMUnAEy9c_k=/not_so_animated_image.gif")
        os.makedirs(dirname(expected_path))
        with open(expected_path, "w") as img:
            img.write(not_so_animated_image())

        response = self.fetch("/HPbIwc4ACNupMwcOQMUnAEy9c_k=/not_so_animated_image.gif")
        expect(response.code).to_equal(200)
        expect(response.body).to_be_similar_to(not_so_animated_image())
예제 #2
0
    def test_loads_image_from_result_storage(self):
        self.context.request = Mock(
            accepts_webp=False,
        )
        expected_path = self.result_storage.normalize_path('5Xr8gyuWE7jL_VB72K0wvzTMm2U=/animated-one-frame.gif')
        os.makedirs(dirname(expected_path))
        with open(expected_path, 'w') as img:
            img.write(not_so_animated_image())

        response = self.fetch('/5Xr8gyuWE7jL_VB72K0wvzTMm2U=/animated-one-frame.gif')
        expect(response.code).to_equal(200)
        expect(response.body).to_be_similar_to(not_so_animated_image())
예제 #3
0
    def test_loads_image_from_result_storage(self):
        self.context.request = Mock(accepts_webp=False, )
        expected_path = self.result_storage.normalize_path(
            '5Xr8gyuWE7jL_VB72K0wvzTMm2U=/animated-one-frame.gif')
        os.makedirs(dirname(expected_path))
        with open(expected_path, 'w') as img:
            img.write(not_so_animated_image())

        response = self.fetch(
            '/5Xr8gyuWE7jL_VB72K0wvzTMm2U=/animated-one-frame.gif')
        expect(response.code).to_equal(200)
        expect(response.body).to_be_similar_to(not_so_animated_image())
예제 #4
0
    def test_loads_image_from_result_storage(self):
        self.context.request = Mock(
            accepts_webp=False,
        )
        expected_path = self.result_storage.normalize_path('HPbIwc4ACNupMwcOQMUnAEy9c_k=/not_so_animated_image.gif')
        os.makedirs(dirname(expected_path))
        with open(expected_path, 'w') as img:
            img.write(not_so_animated_image())

        response = self.fetch('/HPbIwc4ACNupMwcOQMUnAEy9c_k=/not_so_animated_image.gif')
        expect(response.code).to_equal(200)
        expect(response.body).to_be_similar_to(not_so_animated_image())
예제 #5
0
    def test_should_be_ok_with_single_frame_gif(self):
        response = self.fetch(
            '/5Xr8gyuWE7jL_VB72K0wvzTMm2U=/animated-one-frame.gif')

        expect(response.code).to_equal(200)
        expect(response.headers['Content-Type']).to_equal('image/gif')
        expect(response.body).to_be_similar_to(not_so_animated_image())
예제 #6
0
    def test_should_be_ok_with_single_frame_gif(self):
        response = self.fetch(
            '/HPbIwc4ACNupMwcOQMUnAEy9c_k=/not_so_animated_image.gif')

        expect(response.code).to_equal(200)
        expect(response.headers['Content-Type']).to_equal('image/gif')
        expect(response.body).to_be_similar_to(not_so_animated_image())
    async def test_should_be_ok_with_single_frame_gif(self):
        response = await self.async_fetch(
            "/5Xr8gyuWE7jL_VB72K0wvzTMm2U=/animated-one-frame.gif"
        )

        expect(response.code).to_equal(200)
        expect(response.headers["Content-Type"]).to_equal("image/gif")
        expect(response.body).to_be_similar_to(not_so_animated_image())
예제 #8
0
    def test_should_be_ok_with_single_frame_gif(self):
        response = self.fetch('/5Xr8gyuWE7jL_VB72K0wvzTMm2U=/animated-one-frame.gif')

        expect(response.code).to_equal(200)
        expect(response.headers['Content-Type']).to_equal('image/gif')
        expect(response.body).to_be_similar_to(not_so_animated_image())
예제 #9
0
    def test_should_be_ok_with_single_frame_gif(self):
        response = self.fetch('/HPbIwc4ACNupMwcOQMUnAEy9c_k=/not_so_animated_image.gif')

        expect(response.code).to_equal(200)
        expect(response.headers['Content-Type']).to_equal('image/gif')
        expect(response.body).to_be_similar_to(not_so_animated_image())