diff --git a/test_mpsd-software.py b/test_mpsd-software.py index fd0434adaf4f6b583d017cafdcde8f8c1202c687..70340fceecd2da263e459bffb78f48953a55dc59 100644 --- a/test_mpsd-software.py +++ b/test_mpsd-software.py @@ -446,14 +446,12 @@ def test_create_log_file_names(): assert build_log_file_name is None -def test_environment_status(tmp_path): - """Test that the environment status is correct.""" - toolchain_map = mod.environment_status("fake-release", tmp_path) - assert toolchain_map is None - # create a fake environment - mpsd_release = "dev-23a" - test_microarch = mod.get_native_microarchitecture() - expected_toolchain_map = {test_microarch: ["foss2021a", "intel2021a"]} +def create_fake_environment(tmp_path, mpsd_release, expected_toolchain_map=None): + """Create a fake environment with toolchains for testing.""" + if not expected_toolchain_map: + test_microarch = mod.get_native_microarchitecture() + expected_toolchain_map = {test_microarch: ["foss2021a", "intel2021a"]} + for microarch in expected_toolchain_map.keys(): toolchain_lmod_folder = ( tmp_path / mpsd_release / microarch / "lmod" / "Core" / "toolchains"