diff --git a/mpsd-software-environment.py b/mpsd-software-environment.py
index 7e177592b0584afba81563036e474ec695939ec5..76690377c802b1cf0fd05a4fb704228f8c9b396b 100755
--- a/mpsd-software-environment.py
+++ b/mpsd-software-environment.py
@@ -843,7 +843,7 @@ def environment_status(mpsd_release, script_dir):
             f"Release {mpsd_release} has not been completly installed yet"
             ", try reinstalling it (spack directory not found)"
         )
-        return
+        return None
     # find all folders for all microarch in the release directory
     # except for the blacklisted files
     black_listed_files = [
@@ -873,6 +873,7 @@ def environment_status(mpsd_release, script_dir):
         plog.info(f"- {microarch}: \n \t {toolchains}")
     return toolchain_map
 
+
 def main():
     """Execute main entry point."""
     parser = argparse.ArgumentParser(description=about_tool)
diff --git a/tests.py b/tests.py
index c284591902e312c7b7d662a9da542894443e0681..27bbad075251af5ca1010201bf0710d97d5c6a6a 100644
--- a/tests.py
+++ b/tests.py
@@ -424,6 +424,28 @@ 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"
+    mpsd_microarch = "sandybridge"
+    expected_toochain_map = {"sandybridge": ["foss2021a", "intel2021a"]}
+    for mpsd_release in expected_toochain_map.keys():
+        toolchain_files_path = (
+            tmp_path / mpsd_release / mpsd_microarch / "lmod" / "Core" / "toolchains"
+        )
+        toolchain_files_path.mkdir(parents=True)
+        for toolchain in expected_toochain_map[mpsd_release]:
+            toolchain_file = toolchain_files_path / f"{toolchain}.lua"
+            toolchain_file.touch()
+
+    # check that the environment status is correct
+    toolchain_map = mod.environment_status(mpsd_release, tmp_path)
+    assert toolchain_map == expected_toochain_map
+
+
 def test_interface(tmp_path):
     """Test other things (not implemented yet)."""
     pass