Skip to content

Commit

Permalink
add canonical test
Browse files Browse the repository at this point in the history
  • Loading branch information
SandrineP committed Jan 29, 2025
1 parent 2ac45ad commit 7ed2b6e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions micromamba/tests/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,26 @@ def test_list_explicit(
assert "#" not in output


@pytest.mark.parametrize("canonical_flag", ["", "--canonical"])
@pytest.mark.parametrize("env_selector", ["", "name", "prefix"])
@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
def test_list_canonical(
tmp_home, tmp_root_prefix, tmp_env_name, tmp_xtensor_env, env_selector, canonical_flag
):
if env_selector == "prefix":
res = helpers.umamba_list("-p", tmp_xtensor_env, canonical_flag)
elif env_selector == "name":
res = helpers.umamba_list("-n", tmp_env_name, canonical_flag)
else:
res = helpers.umamba_list(canonical_flag)

outputs_list = res.strip().split("\n")[2:]
if canonical_flag == "--canonical":
items = ["conda-forge", "/", " "]
for output in outputs_list:
assert all(i not in output for i in items)


@pytest.mark.parametrize("quiet_flag", ["", "-q", "--quiet"])
@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
def test_list_name(tmp_home, tmp_root_prefix, tmp_xtensor_env, quiet_flag):
Expand Down

0 comments on commit 7ed2b6e

Please sign in to comment.