print("Processing recipe file: %s" % self.file_path)
with open(self.file_path, "r", encoding="utf-8") as _file:
self.csv_reader = csv.DictReader(_file)
- self.rows = tuple(self.csv_reader)
+ self.rows = tuple(list(self.csv_reader))
# Validate data
uuids = {x["recipe_id"] for x in self.rows}
"""
import os
import unittest
+from unittest.mock import patch
import pytest
exit_code, _ = r.recipes_overview()
assert exit_code == 0
+ @unittest.skip("Not implemented")
+ def test_recipes_overview_process_data_dupe_recipe_uuids_throws_key_error(self):
+ """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.rows", return_value={1, 2}):
+ 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):