Пример #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())