aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/test_file_utils.py
diff options
context:
space:
mode:
authorBonfaceKilz2021-03-10 12:03:01 +0300
committerBonfaceKilz2021-03-10 12:03:01 +0300
commit5caff3fbc6e81348f0bc03cda6a43183718a6f3c (patch)
tree11b4e700a3ad0f13f5c13222827ffbe0811d5bcd /tests/unit/test_file_utils.py
parent66d0e35381ada75a8958847281d17682595f537d (diff)
downloadgenenetwork3-5caff3fbc6e81348f0bc03cda6a43183718a6f3c.tar.gz
Add extra tests for file utils
In test server, files were not extracted properly. This test exposes the bug.
Diffstat (limited to 'tests/unit/test_file_utils.py')
-rw-r--r--tests/unit/test_file_utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/unit/test_file_utils.py b/tests/unit/test_file_utils.py
index bd54a6a..b319693 100644
--- a/tests/unit/test_file_utils.py
+++ b/tests/unit/test_file_utils.py
@@ -56,6 +56,10 @@ non-existent"""
token="abcdef-abcdef")
mock_fileobj.save.assert_called_once_with("/tmp/abcdef-abcdef/"
"upload-data.tar.gz")
+ mock_tarfile.open.assert_called_once_with("/tmp/abcdef-abcdef/"
+ "upload-data.tar.gz")
+ mock_tarfile.open.return_value.extractall.assert_called_once_with(
+ path='/tmp/abcdef-abcdef')
mock_file.assert_called_once_with("upload-data.tar.gz")
self.assertEqual(result, {"status": 0, "token": "abcdef-abcdef"})