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())
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())
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())
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())
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())
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())
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())
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())