From 8f6a4198766e9a745578dd8087bfb25a23b19a7e Mon Sep 17 00:00:00 2001 From: Paul Prescod Date: Thu, 26 Nov 2020 03:29:39 -0800 Subject: [PATCH 1/2] Update test to match Snowfakery's updated continuation API --- .../bulkdata/tests/test_generate_from_snowfakery_task.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cumulusci/tasks/bulkdata/tests/test_generate_from_snowfakery_task.py b/cumulusci/tasks/bulkdata/tests/test_generate_from_snowfakery_task.py index f8879f0d68..2fec12ab37 100644 --- a/cumulusci/tasks/bulkdata/tests/test_generate_from_snowfakery_task.py +++ b/cumulusci/tasks/bulkdata/tests/test_generate_from_snowfakery_task.py @@ -14,7 +14,7 @@ from cumulusci.tasks.bulkdata.generate_and_load_data_from_yaml import ( GenerateAndLoadDataFromYaml, ) -from snowfakery import data_generator_runtime +from snowfakery import data_generator_runtime, data_generator sample_yaml = Path(__file__).parent / "snowfakery/gen_npsp_standard_objects.yml" simple_yaml = Path(__file__).parent / "snowfakery/include_parent.yml" @@ -217,7 +217,7 @@ def test_mismatched_options(self): task() assert "without num_records_tablename" in str(e.exception) - def generate_continuation_data(self): + def generate_continuation_data(self, fileobj): g = data_generator_runtime.Globals() o = data_generator_runtime.ObjectRow( "Account", {"Name": "Johnston incorporated", "id": 5} @@ -226,14 +226,13 @@ def generate_continuation_data(self): for i in range(0, 5): # burn through 5 imaginary accounts g.id_manager.generate_id("Account") - return yaml.safe_dump(g) + data_generator.save_continuation_yaml(g, fileobj) def test_with_continuation_file(self): - continuation_data = self.generate_continuation_data() with temp_sqlite_database_url() as database_url: with temporary_file_path("cont.yml") as continuation_file_path: with open(continuation_file_path, "w") as continuation_file: - continuation_file.write(continuation_data) + self.generate_continuation_data(continuation_file) task = _make_task( GenerateDataFromYaml, From b0e40567a9d8e352fd5d2cc00cbc2a67839d8e38 Mon Sep 17 00:00:00 2001 From: Paul Prescod Date: Mon, 30 Nov 2020 07:12:36 -0800 Subject: [PATCH 2/2] Support Snowfakery 1.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 343ccdf866..757d4ee5eb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,7 +33,7 @@ sarge==0.1.6 selenium==3.141.0 simple-salesforce==1.10.1 six==1.15.0 -snowfakery==1.2.0 +snowfakery==1.3.0 SQLAlchemy==1.3.20 terminaltables==3.1.0 typing-extensions==3.7.4.3