Skip to content
Snippets Groups Projects
Verified Commit 6194b08b authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: file system: import

parent abefb787
No related branches found
No related tags found
1 merge request!53Draft: ENH: file system: import
Pipeline #31815 failed
...@@ -59,6 +59,12 @@ def teardown_function(function): ...@@ -59,6 +59,12 @@ def teardown_function(function):
d = execute_query("FIND ENTITY WHICH HAS AN ID >= 100") d = execute_query("FIND ENTITY WHICH HAS AN ID >= 100")
if len(d) > 0: if len(d) > 0:
d.delete() d.delete()
try:
path = get_config().get("IntegrationTests",
"test_files.test_import_files_in_dir.local") + "testfolder/"
shutil.rmtree(path)
except Exception as e:
print(e)
try: try:
shutil.rmtree("testfolder") shutil.rmtree("testfolder")
except Exception as e: except Exception as e:
...@@ -276,7 +282,7 @@ def test_import_file(): ...@@ -276,7 +282,7 @@ def test_import_file():
local_file = os.path.join(path, "subfolder", "some_data.csv") local_file = os.path.join(path, "subfolder", "some_data.csv")
with open(local_file, "w") as test_file1: with open(local_file, "w") as test_file1:
test_file1.write("hello, world\n") test_file1.write("hello, world\n")
checksum = db.File.sha512(local_file) checksum = db.File._get_checksum(local_file)
file_ = db.File(import_file=True, # server knows where to look file_ = db.File(import_file=True, # server knows where to look
path="testfolder/subfolder/some_data.csv") path="testfolder/subfolder/some_data.csv")
...@@ -290,7 +296,7 @@ def test_import_file(): ...@@ -290,7 +296,7 @@ def test_import_file():
assert re.checksum == checksum assert re.checksum == checksum
downloaded_file = re.download() downloaded_file = re.download()
assert db.File.sha512(downloaded_file) == checksum assert db.File._get_checksum(downloaded_file) == checksum
finally: finally:
try: try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment