From 9ff86f1af651c7ee586936435edc75888d6eb8c3 Mon Sep 17 00:00:00 2001
From: iamashwin99 <ashwin-kumar.karnad@mpsd.mpg.de>
Date: Wed, 7 Jun 2023 16:01:52 +0200
Subject: [PATCH] make tests more precise

---
 tests.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests.py b/tests.py
index 0860417..3ebc8d4 100644
--- a/tests.py
+++ b/tests.py
@@ -291,7 +291,7 @@ def test_install_environment_zlib():
             f"{mpsd_release_to_test}_{mpsd_microarch}_*_install.log"
         )
     )
-    assert len(build_log) > 0
+    assert len(build_log) == 2
     # take the most recent build log
     build_log = sorted(build_log)[0]
     # check that the build log contains statement ##### Installation finished
@@ -325,6 +325,10 @@ def test_install_environment_zlib():
     # they are already present works as expected
     # reload the module to ensure that date changes
     importlib.reload(mod)
+    mod.set_up_logging(
+        "WARNING",
+        mod.get_installer_log_file(mpsd_release_to_test, "install", script_dir),
+    )
     mod.install_environment(
         mpsd_release=mpsd_release_to_test,
         toolchains=[toolchain_to_test],
@@ -336,7 +340,7 @@ def test_install_environment_zlib():
             f"{mpsd_release_to_test}_{mpsd_microarch}_*_install.log"
         )
     )
-    assert len(build_log) > 2
+    assert len(build_log) == 4
 
 
 def test_metadata_logging(tmp_path):
-- 
GitLab