]> Nutra Git (v1) - nutratech/cli.git/commitdiff
re-enable & fix recipe (invalid path) test
authorShane Jaroch <chown_tee@proton.me>
Fri, 12 Apr 2024 23:16:44 +0000 (19:16 -0400)
committerShane Jaroch <chown_tee@proton.me>
Fri, 12 Apr 2024 23:16:44 +0000 (19:16 -0400)
tests/services/test_recipe.py

index 7b0138f5e3aed06d441a469693c9e43df0507001..681341225d086a71d43cf5da9745767f16deab95 100644 (file)
@@ -40,14 +40,12 @@ class TestRecipe(unittest.TestCase):
             with pytest.raises(KeyError):
                 r.recipes_overview()
 
-    @unittest.expectedFailure
-    @pytest.mark.xfail(reason="Due to a wip refactor")
-    def test_recipe_overview_throws_exc_for_nonexistent_path(self):
-        """Raises index error if recipe int id is invalid"""
+    def test_recipe_overview_returns_exit_code_1_for_nonexistent_path(self):
+        """Returns (1, None) if recipe path is invalid"""
 
         # TODO: should we be using guid / uuid instead of integer id?
-        with pytest.raises(IndexError):
-            r.recipe_overview("-12345-FAKE-PATH-")
+        result = r.recipe_overview("-12345-FAKE-PATH-")
+        assert (1, None) == result
 
     def test_recipe_overview_might_succeed_for_maybe_existing_id(self):
         """Tries 'check for existing ID', but only can if the user initialized"""