diff --git a/tests/test_mpsd_software.py b/tests/test_mpsd_software.py
index 514c8e5fabd8817fe693ed19e2c50d0ca60abc15..73ef4b1b541a45f383ff4809835d65cd8c77442b 100644
--- a/tests/test_mpsd_software.py
+++ b/tests/test_mpsd_software.py
@@ -520,6 +520,21 @@ def test_remove_environment(tmp_path):
     # done in test_install_environment_zlib
 
 
+def test_initialize_environment(tmp_path):
+    """Test that init_file is created as expected."""
+    # test that the init file is created as expected
+    mod.initialize_environment(tmp_path)
+    init_file = tmp_path / mod.config_vars["init_file"]
+
+    assert init_file.exists()
+
+    # test that calling again results in warning and exit code 1
+    with pytest.raises(SystemExit) as pytest_wrapped_e:
+        mod.initialize_environment(tmp_path)
+    assert pytest_wrapped_e.type == SystemExit
+    assert pytest_wrapped_e.value.code == 1
+
+
 def test_interface(tmp_path):
     """Test other things (not implemented yet)."""
     pass