Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kessler-frost committed Nov 24, 2023
1 parent 2f1f584 commit 04c44fd
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tests/covalent_dispatcher_tests/_dal/asset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_asset_load_data():
temppath = temp.name
key = os.path.basename(temppath)

storage_path = "/tmp"
storage_path = temppath[: -len(key)]

rec = get_asset_record(storage_path, key)
a = Asset(None, rec)
Expand All @@ -65,7 +65,9 @@ def test_asset_store_data():
with tempfile.NamedTemporaryFile("w", delete=True, suffix=".txt") as temp:
temppath = temp.name
key = os.path.basename(temppath)
storage_path = "/tmp"

storage_path = temppath[: -len(key)]

rec = get_asset_record(storage_path, key)
a = Asset(None, rec)
a.store_data("Hello\n")
Expand All @@ -80,7 +82,8 @@ def test_upload_asset():
with tempfile.NamedTemporaryFile("w", delete=True, suffix=".txt") as temp:
src_path = temp.name
src_key = os.path.basename(src_path)
storage_path = "/tmp"

storage_path = src_path[: -len(src_key)]

rec = get_asset_record(storage_path, src_key)
a = Asset(None, rec)
Expand All @@ -101,10 +104,12 @@ def test_download_asset():
with tempfile.NamedTemporaryFile("w", delete=True, suffix=".txt") as temp:
src_path = temp.name
src_key = os.path.basename(src_path)

with open(src_path, "w") as f:
f.write("Hello\n")

storage_path = "/tmp"
storage_path = src_path[: -len(src_key)]

with tempfile.NamedTemporaryFile("w", delete=True, suffix=".txt") as temp:
dest_path = temp.name
dest_key = os.path.basename(dest_path)
Expand All @@ -123,10 +128,11 @@ def test_copy_asset():
with tempfile.NamedTemporaryFile("w", delete=True, suffix=".txt") as temp:
src_path = temp.name
src_key = os.path.basename(src_path)

with open(src_path, "w") as f:
f.write("Hello\n")

storage_path = "/tmp"
storage_path = src_path[: -len(src_key)]
rec = get_asset_record(storage_path, src_key)
src_asset = Asset(None, rec)

Expand Down

0 comments on commit 04c44fd

Please sign in to comment.