]> Nutra Git (v1) - nutratech/cli.git/commitdiff
make `_aggregate_rows()` method private
authorShane Jaroch <chown_tee@proton.me>
Thu, 18 Apr 2024 19:12:55 +0000 (15:12 -0400)
committerShane Jaroch <chown_tee@proton.me>
Thu, 18 Apr 2024 19:12:55 +0000 (15:12 -0400)
ntclient/models/__init__.py
tests/services/test_recipe.py

index 5f39fbd28021021ba7f86f11506efd59f46ef608..bea2910da3ae121dc20799f53e54a900b44c8ddb 100644 (file)
@@ -27,7 +27,7 @@ class Recipe:
 
         self.food_data = {}  # type: ignore
 
-    def aggregate_rows(self) -> tuple:
+    def _aggregate_rows(self) -> tuple:
         """Aggregate rows into a tuple"""
         print("Processing recipe file: %s" % self.file_path)
         with open(self.file_path, "r", encoding="utf-8") as _file:
@@ -44,7 +44,7 @@ class Recipe:
         """
 
         # Read into memory
-        self.rows = self.aggregate_rows()
+        self.rows = self._aggregate_rows()
 
         # Validate data
         uuids = {x["recipe_id"] for x in self.rows}
index 76a2f05a45115f12404fc17e057570576ac83582..c6c2cc3b850c29860280dac783e41da27245b5c9 100644 (file)
@@ -38,7 +38,7 @@ class TestRecipe(unittest.TestCase):
         """Raises key error if recipe uuids are not unique"""
         # TODO: return_value should be a list of recipe dicts, each with a 'uuid' key
         with patch(
-            "ntclient.models.Recipe.aggregate_rows",
+            "ntclient.models.Recipe._aggregate_rows",
             return_value=[{"recipe_id": "UUID_1"}, {"recipe_id": "UUID_2"}],
         ):
             with pytest.raises(KeyError):