Skip to content

Commit

Permalink
Merge pull request #388 from wjjmjh/196_path_bug
Browse files Browse the repository at this point in the history
BUG: fixed testing files path issues to store them into generated tem…
  • Loading branch information
GavinHuttley committed Nov 14, 2019
2 parents e5d5503 + de88295 commit 9168c9b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_app/test_data_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,10 @@ def test_write_class_source_create_delete(self):
path = os.path.join(dirname, "delme_dir")
os.mkdir(path)
with zipfile.ZipFile(os.path.join(path, self.basedir), "w") as myzip:
with open("dummyPrefix_.dummySuffix", "w"):
test_path1 = os.path.join(path, "dummyPrefix_.dummySuffix")
with open(test_path1, "w"):
pass
myzip.write("dummyPrefix_.dummySuffix")
myzip.write(test_path1)
# tests the case when the ZippedDataStore has other different suffixes to self.suffix
with self.assertRaises(RuntimeError):
dstore = self.WriteClass(
Expand All @@ -350,9 +351,10 @@ def test_write_class_source_create_delete(self):
)
# tests the case when the ZippedDataStore only contains files with the same suffix as self.suffix
with zipfile.ZipFile("delme.zip", "w") as myzip:
with open("dummyPrefix_.json", "w"):
test_path2 = os.path.join(path, "dummyPrefix_.json")
with open(test_path2, "w"):
pass
myzip.write("dummyPrefix_.json")
myzip.write(test_path2)
dstore = self.WriteClass(
"delme.zip", suffix=".json", if_exists=OVERWRITE, create=True
)
Expand Down

0 comments on commit 9168c9b

Please sign in to comment.