Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Test fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Apr 8, 2015
1 parent c2cee2d commit b4fe99e
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions tests/py/fixtures/TestNotifyParticipants.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
interactions:
- request:
body: '{"amount": 1061, "meta": {"state": "new", "participant_id": 2}, "description":
"janet"}'
headers: {}
method: POST
uri: https://api.balancedpayments.com:443/cards/CC6j2lN0CEuf3wt77J2bQW7r/card_holds
response:
body: {string: !!python/unicode "{\n \"errors\": [\n {\n \"status\":
\"Conflict\",\n \"category_code\": \"card-not-valid\",\n \"additional\":
null,\n \"status_code\": 409,\n \"category_type\": \"logical\",\n
\ \"extras\": {},\n \"request_id\": \"OHMfbff8b86de4111e4a95a06429171ffad\",\n
\ \"description\": \"Card has been invalidated. Your request id is OHMfbff8b86de4111e4a95a06429171ffad.\"\n
\ }\n ]\n}"}
headers:
content-length: ['373']
content-type: [application/json]
status: {code: 409, message: CONFLICT}
- request:
body: null
headers: {}
method: GET
uri: https://api.balancedpayments.com:443/credits?meta%5Bcontains%5D=exchange_id&limit=25&offset=0
response:
body: {string: !!python/unicode "{\n \"credits\": [],\n \"meta\": {\n \"last\":
\"/credits?limit=25&meta%5Bcontains%5D=exchange_id&offset=0\",\n \"next\":
null,\n \"href\": \"/credits?limit=25&meta%5Bcontains%5D=exchange_id&offset=0\",\n
\ \"limit\": 25,\n \"offset\": 0,\n \"previous\": null,\n \"total\":
0,\n \"first\": \"/credits?limit=25&meta%5Bcontains%5D=exchange_id&offset=0\"\n
\ },\n \"links\": {}\n}"}
headers:
content-length: ['360']
content-type: [application/json]
status: {code: 200, message: OK}
- request:
body: null
headers: {}
method: GET
uri: https://api.balancedpayments.com:443/debits?meta%5Bcontains%5D=exchange_id&limit=25&offset=0
response:
body: {string: !!python/unicode "{\n \"meta\": {\n \"last\": \"/debits?limit=25&meta%5Bcontains%5D=exchange_id&offset=0\",\n
\ \"next\": null,\n \"href\": \"/debits?limit=25&meta%5Bcontains%5D=exchange_id&offset=0\",\n
\ \"limit\": 25,\n \"offset\": 0,\n \"previous\": null,\n \"total\":
0,\n \"first\": \"/debits?limit=25&meta%5Bcontains%5D=exchange_id&offset=0\"\n
\ },\n \"links\": {},\n \"debits\": []\n}"}
headers:
content-length: ['356']
content-type: [application/json]
status: {code: 200, message: OK}
version: 1

3 comments on commit b4fe99e

@Changaco
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid adding test fixtures when you're not actually testing the interaction with the remote service.

@chadwhitacre
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By using mock to stub out the call?

@chadwhitacre
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or by unrolling the test to avoid the external calls entirely: bd5f789.

!m @Changaco

Please sign in to comment.