Skip to content

Commit

Permalink
Simplify example
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Prescod committed Apr 26, 2023
1 parent d0236bd commit 234da0e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
8 changes: 5 additions & 3 deletions examples/salesforce_soql_example_no_records.recipe.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
- plugin: snowfakery.standard_plugins.Salesforce.SalesforceQuery
- object: Contact
fields:
FirstName: Suzy
LastName: Salesforce
FirstName: Keyser
LastName: Söze
AccountId:
SalesforceQuery.random_record: Contract
SalesforceQuery.random_record:
from: Account
where: Name='Hungarian Mafia' # no such record
17 changes: 17 additions & 0 deletions tests/cassettes/TestSOQLWithCCI.test_example_no_records.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,21 @@ interactions:
status:
code: 200
message: OK
- request:
body: null
headers:
Request-Headers:
- Elided
method: GET
uri: https://orgname.my.salesforce.com/services/data/vxx.0/query/?q=SELECT+count%28%29+FROM+Account+WHERE+Name%3D%27Hungarian+Mafia%27
response:
body:
string: "{\n \"totalSize\" : 0,\n \"done\" : true,\n \"records\" : [ ]\n}"
headers:
Content-Type:
- application/json;charset=UTF-8
Others: Elided
status:
code: 200
message: OK
version: 1
2 changes: 1 addition & 1 deletion tests/test_with_cci.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def test_example_no_records(self, sf, generated_rows, org_config):
)
with pytest.raises(
DataGenError,
match=".*AccountId(.|\n)*No records found matching Contract.*",
match=".*AccountId(.|\n)*No records found matching .*Hungarian.*",
):
generate_data(filename, plugin_options={"org_name": org_config.name})

Expand Down

0 comments on commit 234da0e

Please sign in to comment.