|
@@ -165,6 +165,8 @@ class FileGettingTests(_BaseFileTests):
|
|
|
self.assertFalse(response.is_json)
|
|
|
self.assertEqual(content, response.data)
|
|
|
|
|
|
+ response.close()
|
|
|
+
|
|
|
def test_get_prev_next_file(self):
|
|
|
|
|
|
for i in range(1, 6):
|
|
@@ -267,7 +269,7 @@ class FileResizingTests(_BaseFileTests):
|
|
|
@pаtch_tpool_execute
|
|
|
def test_resize_image(self, mocked_execute):
|
|
|
|
|
|
- self.get(url_for("get_resized_file", file_id=4242, resolution=300), status_code=404)
|
|
|
+ self.get(url_for("get_resized_file", file_id=4242, resolution=300), status_code=404).close()
|
|
|
|
|
|
file_uuid = str(uuid.uuid1())
|
|
|
file, is_new = self.project.add_file(
|
|
@@ -290,6 +292,7 @@ class FileResizingTests(_BaseFileTests):
|
|
|
self.assertFalse(response.is_json)
|
|
|
|
|
|
returned_im = _im_from_bytes(response.data)
|
|
|
+ response.close()
|
|
|
|
|
|
self.assertEqual(image.shape, returned_im.shape)
|
|
|
self._compare_images(image, returned_im)
|
|
@@ -305,6 +308,7 @@ class FileResizingTests(_BaseFileTests):
|
|
|
self.assertFalse(response.is_json)
|
|
|
|
|
|
returned_im = _im_from_bytes(response.data)
|
|
|
+ response.close()
|
|
|
|
|
|
self.assertEqual(sm_image.shape, returned_im.shape)
|
|
|
self._compare_images(sm_image, returned_im)
|
|
@@ -360,11 +364,11 @@ class FileResizingTests(_BaseFileTests):
|
|
|
url = url_for("get_cropped_file", file_id=file.id,
|
|
|
resolution=300, crop_box="0x0x1x1")
|
|
|
response = self.get(url, status_code=404)
|
|
|
+ response.close()
|
|
|
|
|
|
file.path = save
|
|
|
file.commit()
|
|
|
|
|
|
-
|
|
|
@pаtch_tpool_execute
|
|
|
def test_crop_image(self, mocked_execute):
|
|
|
|
|
@@ -390,6 +394,7 @@ class FileResizingTests(_BaseFileTests):
|
|
|
self.assertFalse(response.is_json)
|
|
|
|
|
|
returned_im = _im_from_bytes(response.data)
|
|
|
+ response.close()
|
|
|
|
|
|
crop = _crop(image, BoundingBox(*box))
|
|
|
self.assertEqual(crop.shape, returned_im.shape)
|