From 4ccefa9470f8829e8721279a9be1c7bc823f0043 Mon Sep 17 00:00:00 2001
From: dcarron <daniel.carron@idiap.ch>
Date: Wed, 31 Jan 2024 10:28:46 +0100
Subject: [PATCH] [test] Check saliency outputs in experiment test

---
 tests/test_cli.py | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/tests/test_cli.py b/tests/test_cli.py
index f56bc43f..1ac304a1 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -498,6 +498,38 @@ def test_experiment(temporary_basedir):
     assert os.path.exists(
         os.path.join(output_folder, "evaluation", "summary.rst")
     )
+    assert os.path.exists(os.path.join(output_folder, "gradcam", "saliencies"))
+    assert (
+        len(
+            glob.glob(
+                os.path.join(
+                    output_folder,
+                    "gradcam",
+                    "saliencies",
+                    "CXR_png",
+                    "MCUCXR_*.npy",
+                )
+            )
+        )
+        == 138
+    )
+    assert os.path.exists(
+        os.path.join(output_folder, "gradcam", "visualizations")
+    )
+    assert (
+        len(
+            glob.glob(
+                os.path.join(
+                    output_folder,
+                    "gradcam",
+                    "visualizations",
+                    "CXR_png",
+                    "MCUCXR_*.png",
+                )
+            )
+        )
+        == 58
+    )
 
 
 # This script does not work anymore, either fix or remove the script + this test
-- 
GitLab