aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/test_file_utils.py
diff options
context:
space:
mode:
authorAlexander Kabui2021-05-15 01:20:46 +0300
committerGitHub2021-05-15 01:20:46 +0300
commitc69b11cffba7547d65ac9812b0118cddad91be0d (patch)
treebfa55c23f702db5072e8839e44961dd72fd4a9e2 /tests/unit/test_file_utils.py
parentbcba700bd2835f0a36042d781860b3407519f6d8 (diff)
parent46a96ec0b89620eed4874ada565a9643ac19a042 (diff)
downloadgenenetwork3-c69b11cffba7547d65ac9812b0118cddad91be0d.tar.gz
Merge branch 'main' into feature/minor-fixes
Diffstat (limited to 'tests/unit/test_file_utils.py')
-rw-r--r--tests/unit/test_file_utils.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/unit/test_file_utils.py b/tests/unit/test_file_utils.py
index cc842d5..75be4f6 100644
--- a/tests/unit/test_file_utils.py
+++ b/tests/unit/test_file_utils.py
@@ -1,14 +1,14 @@
-"""Test cases for procedures defined in file_utils.py"""
+"""Test cases for procedures defined in fs_helpers.py"""
import os
import unittest
from dataclasses import dataclass
from typing import Callable
from unittest import mock
-from gn3.file_utils import extract_uploaded_file
-from gn3.file_utils import get_dir_hash
-from gn3.file_utils import jsonfile_to_dict
-from gn3.file_utils import cache_ipfs_file
+from gn3.fs_helpers import extract_uploaded_file
+from gn3.fs_helpers import get_dir_hash
+from gn3.fs_helpers import jsonfile_to_dict
+from gn3.fs_helpers import cache_ipfs_file
@dataclass
@@ -19,7 +19,7 @@ class MockFile:
class TestFileUtils(unittest.TestCase):
- """Test cases for procedures defined in file_utils.py"""
+ """Test cases for procedures defined in fs_helpers.py"""
def test_get_dir_hash(self):
"""Test that a directory is hashed correctly"""
@@ -45,8 +45,8 @@ non-existent"""
self.assertRaises(FileNotFoundError, jsonfile_to_dict,
"/non-existent-dir")
- @mock.patch("gn3.file_utils.tarfile")
- @mock.patch("gn3.file_utils.secure_filename")
+ @mock.patch("gn3.fs_helpers.tarfile")
+ @mock.patch("gn3.fs_helpers.secure_filename")
def test_extract_uploaded_file(self, mock_file, mock_tarfile):
"""Test that the gzip file is extracted to the right location"""
mock_file.return_value = "upload-data.tar.gz"
@@ -65,7 +65,7 @@ non-existent"""
mock_file.assert_called_once_with("upload-data.tar.gz")
self.assertEqual(result, {"status": 0, "token": "abcdef-abcdef"})
- @mock.patch("gn3.file_utils.secure_filename")
+ @mock.patch("gn3.fs_helpers.secure_filename")
def test_extract_uploaded_file_non_existent_gzip(self, mock_file):
"""Test that the right error message is returned when there is a problem
extracting the file"""
@@ -96,7 +96,7 @@ extracting the file"""
os.rmdir(test_dir)
self.assertEqual(file_loc, f"{test_dir}/genotype.txt")
- @mock.patch("gn3.file_utils.ipfshttpclient")
+ @mock.patch("gn3.fs_helpers.ipfshttpclient")
def test_cache_ipfs_file_cache_miss(self,
mock_ipfs):
"""Test that a file is cached if there's a cache miss"""