Skip to content

Commit 8d85c46

Browse files
committed
Fixing tests
1 parent 705ece9 commit 8d85c46

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

tests/test_cli.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,21 @@ def test_pack_env(self, tmp_path, use_cache):
8282
print(result.stdout)
8383
assert result.exit_code == 0
8484

85-
# check that there is a json with all the packages
85+
# check that there is a json in the output
8686
env_metadata_json_path = tmp_path / "empack_env_meta.json"
8787
assert env_metadata_json_path.exists()
8888

89+
# check the mount point is defined in the lock file
8990
with open(env_metadata_json_path) as f:
9091
env_meta = json.load(f)
92+
mount_points = env_meta["mounts"]
9193
packages = env_meta["packages"]
9294
env_meta_dict = dict()
9395

96+
for pkg in mount_points:
97+
env_meta_dict[pkg["filename"]] = pkg
9498
for pkg in packages:
95-
env_meta_dict[pkg["name"]] = pkg
99+
env_meta_dict[pkg["filename"]] = pkg
96100

97101
assert "packaged_dir.tar.gz" in env_meta_dict
98102
assert "numpy" in env_meta_dict

tests/test_pack.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,17 @@ def test_append(tmp_path):
8686
# append the directory to the env
8787
add_tarfile_to_env_meta(env_meta_filename=tmp_path, tarfile=tmp_path / "packaged_dir.tar.gz")
8888

89-
# check that there is a json with all the packages
89+
# check that there is a json in the output
9090
env_metadata_json_path = tmp_path / "empack_env_meta.json"
9191
assert env_metadata_json_path.exists()
9292

93+
# check the mount point is defined in the lock file
9394
with open(env_metadata_json_path) as f:
9495
env_meta = json.load(f)
95-
packages = env_meta["packages"]
96+
mount_points = env_meta["mounts"]
9697
env_meta_dict = dict()
9798

98-
for pkg in packages:
99+
for pkg in mount_points:
99100
env_meta_dict[pkg["filename"]] = pkg
100101

101102
assert "packaged_dir.tar.gz" in env_meta_dict

0 commit comments

Comments
 (0)