Skip to content

Commit

Permalink
Merge pull request #2201 from SFDO-Tooling/feature/continuation-file-…
Browse files Browse the repository at this point in the history
…changes

Use Snowfakery 1.3
  • Loading branch information
David Glick authored Nov 30, 2020
2 parents b107c0e + fe1d735 commit 1300198
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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}
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1300198

Please sign in to comment.