Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integration test errors #3489

Merged
merged 7 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cumulusci/tasks/sample_data/test_capture_sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ def setup_test(org_config):
), responses.RequestsMock() as rsps:
rsps.add(
responses.GET,
f"https://orgname.my.salesforce.com/services/data/v{CURRENT_SF_API_VERSION}/tooling/sobjects",
f"{org_config.instance_url}/services/data/v{CURRENT_SF_API_VERSION}/tooling/sobjects",
json={"sobjects": [{"name": "WebLink"}]},
status=200,
)
yield


class TestCaptureDatasetss:
class TestCaptureDatasets:
@mock.patch("cumulusci.tasks.sample_data.capture_sample_data.Dataset")
def test_simple_extract(
self,
Expand All @@ -55,6 +55,7 @@ def test_simple_extract(
with setup_test(org_config):
task = create_task(CaptureSampleData, {})
task()
print("Dataset.mock_calls", Dataset.mock_calls)
# default dataset should created
Dataset.assert_any_call("default", mock.ANY, mock.ANY, org_config, mock.ANY)
# and extracted
Expand Down
9 changes: 6 additions & 3 deletions cumulusci/tasks/sample_data/test_load_sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def setup_test(org_config):
yield


class TestCaptureDatasets:
class TestLoadDatasets:
@mock.patch("cumulusci.tasks.sample_data.load_sample_data.Dataset")
def test_simple_extract(
self,
Expand All @@ -45,10 +45,13 @@ def test_simple_extract(
org_config,
):
with setup_test(org_config):
org_config.config["config_name"] = "dev"
task = create_task(LoadSampleData, {"ignore_row_errors": True})
task()
# default dataset should opened
Dataset.assert_any_call("default", mock.ANY, mock.ANY, org_config, mock.ANY)
# default dataset should be opened
Dataset.assert_any_call(
org_config.config_name, mock.ANY, mock.ANY, org_config, mock.ANY
)
# and loaded
Dataset().__enter__().load.assert_called_with(
{"ignore_row_errors": True}, task.logger
Expand Down