mirror of
https://0xacab.org/jvoisin/mat2-web.git
synced 2025-05-12 03:05:19 -04:00
Resolve "Delete Files After Adding To Zip"
This commit is contained in:
parent
5570b38f6c
commit
d9d4ebf3a2
3 changed files with 16 additions and 2 deletions
|
@ -3,6 +3,9 @@ import tempfile
|
|||
import json
|
||||
import os
|
||||
import shutil
|
||||
import zipfile
|
||||
|
||||
from six import BytesIO
|
||||
|
||||
import main
|
||||
|
||||
|
@ -208,11 +211,21 @@ class Mat2APITestCase(unittest.TestCase):
|
|||
self.assertEqual(response['meta_after'], {})
|
||||
|
||||
request = self.app.get(response['download_link'])
|
||||
zip_response = zipfile.ZipFile(BytesIO(request.data))
|
||||
self.assertEquals(2, len(zip_response.namelist()))
|
||||
for name in zip_response.namelist():
|
||||
self.assertIn('.cleaned.jpg', name)
|
||||
self.assertEqual(request.status_code, 200)
|
||||
|
||||
request = self.app.get(response['download_link'])
|
||||
self.assertEqual(request.status_code, 404)
|
||||
|
||||
request = self.app.get(upload_one['download_link'])
|
||||
self.assertEqual(request.status_code, 404)
|
||||
|
||||
request = self.app.get(upload_two['download_link'])
|
||||
self.assertEqual(request.status_code, 404)
|
||||
|
||||
def test_api_bulk_download_validation(self):
|
||||
post_body = {
|
||||
u'download_list': [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue