From beafa1b1c612fe96a2ac7c46204e48681e22f521 Mon Sep 17 00:00:00 2001
From: Remi Cresson <remi.cresson@inrae.fr>
Date: Wed, 23 Aug 2023 14:27:22 +0200
Subject: [PATCH] TEST: add testing for extra outputs

---
 test/api_unittest.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/test/api_unittest.py b/test/api_unittest.py
index 73b57b7..aa2f51b 100644
--- a/test/api_unittest.py
+++ b/test/api_unittest.py
@@ -89,14 +89,24 @@ class APITest(unittest.TestCase):
         )
 
         def _test_compare(command):
-                self.assertTrue(
+            self.assertTrue(
                 run_command_and_compare(
                     command=command,
                     to_compare_dict={
                         "$DATADIR/classif_model4_softmax.tif":
                             "$TMPDIR/classif_model4_softmax.tif"
                     },
-                    tol=INFERENCE_MAE_TOL))
+                    tol=INFERENCE_MAE_TOL
+                )
+            )
+
+        def _test_exist(command):
+            self.assertTrue(
+                run_command_and_test_exist(
+                    command=command,
+                    file_list=["$TMPDIR/classif_model4_softmax.tif"]
+                )
+            )
 
         # softmax (from layer name)
         _test_compare(command_crop16_softmax)
@@ -107,8 +117,8 @@ class APITest(unittest.TestCase):
         _test_compare(command_crop32_softmax2)
 
         # argmax
-        self.assertTrue(run_command_and_test_exist(command_crop16_argmax))
-        self.assertTrue(run_command_and_test_exist(command_crop32_argmax))
+        _test_exist(command_crop16_argmax)
+        _test_exist(command_crop32_argmax)
 
     @pytest.mark.order(3)
     def test_create_tfrecords(self):
-- 
GitLab