Skip to content
Snippets Groups Projects
Commit 25b55e4a authored by Ashwin Kumar Karnad's avatar Ashwin Kumar Karnad
Browse files

update tests

parent 2c18dc5e
No related branches found
No related tags found
1 merge request!118add status command arguments
Pipeline #387604 passed
......@@ -502,7 +502,26 @@ def create_fake_environment(tmp_path, mpsd_release, expected_toolchain_map=None)
def test_environment_status(tmp_path):
"""Test that the environment status is correct."""
"""Test that the environment status is correct.
The status command has the following three usage:
- 1) If no mpsd_release, list available releases
- 2) If mpsd_release, list available toolchains
- 3) If mpsd_release and toolchain, list available packages
We need to test all the three cases.
"""
# 1) If no mpsd_release, list available releases
list_of_release_in_empty_dir = mod.environment_status(None, tmp_path)
assert list_of_release_in_empty_dir == []
(tmp_path / "test_case1" / "dev-23a").mkdir(parents=True, exist_ok=True)
(tmp_path / "test_case1" / "fake_release").mkdir(parents=True, exist_ok=True)
list_of_release = mod.environment_status(None, tmp_path / "test_case1")
assert list_of_release == ["dev-23a"]
# 2) If mpsd_release, list available toolchains
toolchain_map = mod.environment_status("fake-release", tmp_path)
assert toolchain_map is None
mpsd_release = "dev-23a"
......@@ -513,6 +532,9 @@ def test_environment_status(tmp_path):
for microarch in expected_toolchain_map.keys():
assert set(toolchain_map[microarch]) == set(expected_toolchain_map[microarch])
# 3) If mpsd_release and toolchain, list available packages
# TODO this test has to be written after the MR from remove mcd is merged
def test_initialise_environment(tmp_path):
"""Test that init_file is created as expected."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment