diff --git a/test/api_unittest.py b/test/api_unittest.py
index 73b57b7d102c15eecae807ec57a28eec2e0d2912..aa2f51b3a146863aab79b74ace1867db0fac7296 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):