def test_modifying_existing_image_to_heavy_image_fails(self):
        response = self.post(self.base_uri, {'Content-Type': 'image/jpeg'}, valid_image())
        location = response.headers['Location']

        response = self.put(location, {'Content-Type': 'image/jpeg'}, too_heavy_image())
        expect(response.code).to_equal(412)

        expected_path = self.get_path_from_location(location)
        expected_path = self.upload_storage.path_on_filesystem(expected_path)
        expect(expected_path).to_exist()
        expect(expected_path).to_be_the_same_as(valid_image_path)
    def test_modifying_existing_image_to_heavy_image_fails(self):
        response = self.post(self.base_uri, {'Content-Type': 'image/jpeg'},
                             valid_image())
        location = response.headers['Location']

        response = self.put(location, {'Content-Type': 'image/jpeg'},
                            too_heavy_image())
        expect(response.code).to_equal(412)

        expected_path = self.get_path_from_location(location)
        expected_path = self.upload_storage.path_on_filesystem(expected_path)
        expect(expected_path).to_exist()
        expect(expected_path).to_be_the_same_as(valid_image_path)
Exemple #3
0
    async def test_modifying_existing_image_to_heavy_image_fails(self):
        response = await self.async_post(self.base_uri,
                                         {"Content-Type": "image/jpeg"},
                                         valid_image())
        location = response.headers["Location"]

        response = await self.async_put(location,
                                        {"Content-Type": "image/jpeg"},
                                        too_heavy_image())
        expect(response.code).to_equal(412)

        expected_path = self.get_path_from_location(location)
        expected_path = self.upload_storage.path_on_filesystem(expected_path)
        expect(expected_path).to_exist()
        expect(expected_path).to_be_the_same_as(VALID_IMAGE_PATH)
 def test_posting_an_image_too_heavy_through_an_html_form_fails(self):
     image = ('media', u'oversized9999.jpg', too_heavy_image())
     response = self.post_files(self.base_uri, {}, (image, ))
     expect(response.code).to_equal(412)
 def test_posting_an_image_too_heavy_fails(self):
     response = self.post(self.base_uri, {'Content-Type': 'image/jpeg'},
                          too_heavy_image())
     expect(response.code).to_equal(412)
Exemple #6
0
 async def test_posting_an_image_too_heavy_through_an_html_form_fails(self):
     image = ("media", "oversized9999.jpg", too_heavy_image())
     response = await self.async_post_files(self.base_uri, {}, (image, ))
     expect(response.code).to_equal(412)
Exemple #7
0
 async def test_posting_an_image_too_heavy_fails(self):
     response = await self.async_post(self.base_uri,
                                      {"Content-Type": "image/jpeg"},
                                      too_heavy_image())
     expect(response.code).to_equal(412)
 def test_posting_an_image_too_heavy_through_an_html_form_fails(self):
     image = ('media', u'oversized9999.jpg', too_heavy_image())
     response = self.post_files(self.base_uri, {}, (image, ))
     expect(response.code).to_equal(412)
 def test_posting_an_image_too_heavy_fails(self):
     response = self.post(self.base_uri, {'Content-Type': 'image/jpeg'}, too_heavy_image())
     expect(response.code).to_equal(412)