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

Refactor test_remove_environment function to use get_important_folders utility

parent 70a37ccb
No related branches found
No related tags found
1 merge request!130Resolve "single function to generate all the folders relative to root_dir"
......@@ -32,8 +32,9 @@ def test_remove_environment(tmp_path, mocker, create_fake_environment):
# check that the release directory is removed and logs are kept
# create a release directory
create_fake_environment(tmp_path, release_to_test)
release_dir = tmp_path / release_to_test / remove.get_native_microarchitecture()
logs_dir = tmp_path / release_to_test / "logs"
folders = mpsd_software_manager.utils.filesystem_utils.get_important_folders(
release_to_test, tmp_path
)
toolchain_map = mpsd_software_manager.cmds.status.environment_status(
release_to_test, tmp_path
......@@ -47,9 +48,9 @@ def test_remove_environment(tmp_path, mocker, create_fake_environment):
# check that no toolchain remains
assert toolchain_map is None
# check that the release directory is empty
assert len(list(release_dir.iterdir())) == 0
assert len(list(folders["release_dir"].iterdir())) == 0
# check that the logs directory is non-empty
list_of_logs = list(logs_dir.iterdir())
list_of_logs = list(folders["logs_dir"].iterdir())
assert len(list_of_logs) == 2 # APEX + remove_build_log
# check that one of the log has 'remove.log' as part of the name
assert "BUILD_ALL_remove.log" in ",".join([str(x) for x in list_of_logs])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment