From f7e78df048916c8c81ad85eac184596c17708e1f Mon Sep 17 00:00:00 2001
From: iamashwin99 <ashwin-kumar.karnad@mpsd.mpg.de>
Date: Tue, 20 Jun 2023 15:36:20 +0200
Subject: [PATCH] add test to check that version is logged

---
 tests/test_mpsd_software.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/test_mpsd_software.py b/tests/test_mpsd_software.py
index 6c6c713..f4564df 100644
--- a/tests/test_mpsd_software.py
+++ b/tests/test_mpsd_software.py
@@ -169,6 +169,7 @@ def test_record_script_execution_summary(tmp_path):
 
     root_dir = tmp_path / "test_prepare_env"
     mpsd_release_to_test = "dev-23a"
+    script_version = mod.__version__
     if os.path.exists(root_dir / cmd_log_file):
         initial_bytes = os.path.getsize(cmd_log_file)
     else:
@@ -184,8 +185,10 @@ def test_record_script_execution_summary(tmp_path):
 
     # Check that the log file has "Spack environments branch: dev-23a " in the last line
     with open(root_dir / cmd_log_file, "r") as f:
-        last_line = f.readlines()[-1]
-        assert "Spack environments branch: dev-23a " in last_line
+        lines = f.readlines()
+        assert "Spack environments branch: dev-23a " in lines[-1]
+        assert f"MPSD Software manager version: {script_version}" in lines[-2]
+
 
 
 def test_install_environment_wrong_package_set(tmp_path):
-- 
GitLab