Skip to content

Commit

Permalink
Merge pull request #187 from EasyPost/strict_cassette_matching
Browse files Browse the repository at this point in the history
fix: matches bodies and headers on VCR cassettes (closes #144)
  • Loading branch information
Justintime50 authored May 5, 2022
2 parents 92ceec4 + 34a52b9 commit e9f34a6
Show file tree
Hide file tree
Showing 85 changed files with 2,715 additions and 3,988 deletions.
43 changes: 20 additions & 23 deletions tests/cassettes/test_address_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ interactions:
- gzip, deflate
Connection:
- keep-alive
Content-type:
- application/json
authorization:
- EZTK-NONE
user-agent:
Expand All @@ -20,27 +18,26 @@ interactions:
uri: https://api.easypost.com/v2/addresses?page_size=5
response:
body:
string: !!binary |
H4sIAAAAAAAAA+yUb2+bMBDGvwri7ZLONgEC71DWSvujJAqZqmmakLGP1huYyDjr2ijfvefQdG0n
TdmmdS8W3oAfHt8d/h238bmUBroOOj/9uPGV9FOUTEHiUlasLHk0IpSCSJJSckGrqCScSAr+wG/L
zyAs+rM+BErCALcgC+5kRhgbkmBI4yVjKY1TFr8gJCUEjeuVPMyoeQNoecPFFy9fcWPaK5enbVZc
X+OLU95dz9vOothZA2ApisF47C3bK92Bll7+/R1zxa6sx1xkoawLkHPtnRmuhepEu3NiYahPMlzc
qBU+JiNK4l3WtbbGbXqf43J12WrnDO8vFKHhqvZTva7rgd+00hks7OoTWL0CU1RcqHqXvHfh2SkJ
2ip+v7ECCYbXheXfCoekV3elPdG+glGVEtyqViPCzXY7eEQxCUlE5Z7imEZVT1HEZRCx56aYTd56
+TxbLGbnjylm+Yf5LF/+SHF2Ps1Pp6+8fOll82VP7h5mfwR7kNnUO1tk08nrfDL7CcghjWLyTDSt
WcOf0HR1j9y9Wwvh4NxFBPwPjPtjPw18CRaL7PoQW7euFca5PnTbxq8xn127jwvikzgOQzrw61Zf
3IlDythJkERJPPCtaqC46U8qa7BawV++a7si0xdQ4wzZbp82YJSEEEYPGhD+ZQMex8jvjJFoRCPB
kzGPgmpHUSZiT5FRNvp1iiwNg4MoPjIex8h/OkawAdk4kMmDBuTHBjw24F9tQAx+ybuiaQ30ibe3
AAAA//8DANXWoMkuCwAA
string: '{"addresses":[{"id":"adr_50ad820bcbe811ec9b88ac1f6bc72124","object":"Address","created_at":"2022-05-04T20:25:18+00:00","updated_at":"2022-05-04T20:25:18+00:00","name":"Jack
Sparrow","company":"EasyPost","street1":"388 Townsend St","street2":"Apt 20","city":"San
Francisco","state":"CA","zip":"94107","country":"US","phone":"5555555555","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},{"id":"adr_5089554ccbe811ec833eac1f6bc7b362","object":"Address","created_at":"2022-05-04T20:25:18+00:00","updated_at":"2022-05-04T20:25:18+00:00","name":"JACK
SPARROW","company":"EASYPOST","street1":"388 TOWNSEND ST APT 20","street2":null,"city":"SAN
FRANCISCO","state":"CA","zip":"94107-1670","country":"US","phone":"5555555555","email":null,"mode":"test","carrier_facility":null,"residential":true,"federal_tax_id":null,"state_tax_id":null,"verifications":{"zip4":{"success":true,"errors":[],"details":null},"delivery":{"success":true,"errors":[],"details":{"latitude":37.77551,"longitude":-122.39697,"time_zone":"America/Los_Angeles"}}}},{"id":"adr_50627986cbe811ec832dac1f6bc7b362","object":"Address","created_at":"2022-05-04T20:25:18+00:00","updated_at":"2022-05-04T20:25:18+00:00","name":"Jack
Sparrow","company":"EasyPost","street1":"388 Townsend St","street2":"Apt 20","city":"San
Francisco","state":"CA","zip":"94107","country":"US","phone":"5555555555","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},{"id":"adr_1fb2b2e0cbe811ec8f80ac1f6bc72124","object":"Address","created_at":"2022-05-04T20:23:56+00:00","updated_at":"2022-05-04T20:23:56+00:00","name":"Jack
Sparrow","company":"EasyPost","street1":"388 Townsend St","street2":"Apt 20","city":"San
Francisco","state":"CA","zip":"94107","country":"US","phone":"5555555555","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}},{"id":"adr_1fb10d4fcbe811ecbfc6ac1f6b0a0d1e","object":"Address","created_at":"2022-05-04T20:23:56+00:00","updated_at":"2022-05-04T20:23:56+00:00","name":"Jack
Sparrow","company":"EasyPost","street1":"388 Townsend St","street2":"Apt 20","city":"San
Francisco","state":"CA","zip":"94107","country":"US","phone":"5555555555","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}}],"has_more":true}'
headers:
cache-control:
- no-cache, no-store
content-encoding:
- gzip
content-length:
- '2488'
content-type:
- application/json; charset=utf-8
etag:
- W/"84f4887853f0c3d6af81b809f895794c"
- W/"2334d979d200223b7446300d30aae440"
expires:
- '0'
pragma:
Expand All @@ -58,20 +55,20 @@ interactions:
x-download-options:
- noopen
x-ep-request-uuid:
- 34f5dd476233b378ff0300ed002aecf1
- 62b330bd6272e12fe786b81f00161429
x-frame-options:
- SAMEORIGIN
x-node:
- bigweb6nuq
- bigweb5nuq
x-permitted-cross-domain-policies:
- none
x-proxied:
- intlb1nuq 3e97db20d4
- extlb1nuq 3e97db20d4
- intlb1nuq fde591f008
- extlb1nuq c51cdb8bf2
x-runtime:
- '0.034936'
- '0.037397'
x-version-label:
- easypost-202203171927-d8d87a16dd-master
- easypost-202205041833-02730cc398-master
x-xss-protection:
- 1; mode=block
status:
Expand Down
32 changes: 14 additions & 18 deletions tests/cassettes/test_address_create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interactions:
- keep-alive
Content-Length:
- '190'
Content-type:
Content-Type:
- application/json
authorization:
- EZTK-NONE
Expand All @@ -24,26 +24,22 @@ interactions:
uri: https://api.easypost.com/v2/addresses
response:
body:
string: !!binary |
H4sIAAAAAAAAA4yRsW7DIBCGX8VibSIBju3EW1S1Q6dKTmfrDGeF1gYLcNM0yrv3cKRU6lQm7uM7
7hdcmNGsZqB9y6tyV2BRQrnhQqDaihJBib7sVNXlpWQr5rp3VJH8vdYeQyCkPEJE3ULCkku55vla
VAcpa1HVsnrgvOacxHnS/xMtjEjKC6iPrJnAe3dKc9w4gT3TwROE86sLkWCIHjEKgvl2mx3cyQa0
Omt+z2QKO8VMppuViemCBmz27MEqE5RbTApG/HFPxbeZaLvbCF4tU2cbfWp6a6icjs4ms7gvgjiC
GVht52FYsdHpJERc8ilKb9C3PSgzLMNvFr2d0WijgXtjjxo9DG2ErzZ9yY0u0f6wT/SmNwqicTaw
+nK9/gAAAP//AwAmcuNUxQEAAA==
string: '{"id":"adr_50627986cbe811ec832dac1f6bc7b362","object":"Address","created_at":"2022-05-04T20:25:18+00:00","updated_at":"2022-05-04T20:25:18+00:00","name":"Jack
Sparrow","company":"EasyPost","street1":"388 Townsend St","street2":"Apt 20","city":"San
Francisco","state":"CA","zip":"94107","country":"US","phone":"5555555555","email":null,"mode":"test","carrier_facility":null,"residential":null,"federal_tax_id":null,"state_tax_id":null,"verifications":{}}'
headers:
cache-control:
- no-cache, no-store
content-encoding:
- gzip
content-length:
- '453'
content-type:
- application/json; charset=utf-8
etag:
- W/"a27b5fa41de73ef9bfbe4dfa55399072"
- W/"8a82345c7581f88348730d03d3544cbe"
expires:
- '0'
location:
- /api/v2/addresses/adr_07695e56a64011ec816eac1f6bc7b362
- /api/v2/addresses/adr_50627986cbe811ec832dac1f6bc7b362
pragma:
- no-cache
referrer-policy:
Expand All @@ -59,20 +55,20 @@ interactions:
x-download-options:
- noopen
x-ep-request-uuid:
- 34f5dd416233b377ff0300ea002aecbd
- 62b330bc6272e12ee786b81c001613cd
x-frame-options:
- SAMEORIGIN
x-node:
- bigweb8nuq
- bigweb5nuq
x-permitted-cross-domain-policies:
- none
x-proxied:
- intlb2nuq 3e97db20d4
- extlb1nuq 3e97db20d4
- intlb1nuq fde591f008
- extlb1nuq c51cdb8bf2
x-runtime:
- '0.031396'
- '0.103171'
x-version-label:
- easypost-202203171927-d8d87a16dd-master
- easypost-202205041833-02730cc398-master
x-xss-protection:
- 1; mode=block
status:
Expand Down
32 changes: 13 additions & 19 deletions tests/cassettes/test_address_create_and_verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,23 @@ interactions:
uri: https://api.easypost.com/v2/addresses/create_and_verify
response:
body:
string: !!binary |
H4sIAAAAAAAAA9SST4+bMBDFvwpyL61KsphA/nBD2aRCSqAK6UpRVSEHD6krY0fGrJqN9rt3TLI9
9LTXcoF5vDf8PMOVMM4NdB1JrkRwkmBtqngaN/HkCMcpiyiF+sijkNW0mR4DFnAKxCf6+Atqi/70
nvdJbYBZ4BVzchiE4SiIRsFsT+dJHCfR/HMQJEGAxv7M32dUrAWSqF5K7K7bM1MXTKzS8vC1KPdo
6KwBsBTFiM68bZHvvxTb1e7glXtvvfHiv5YQLQ5RWNehTHNvvUvzZVYui8GDPKgvUyxexBkfFxFF
KErDhYvpXlnjkt9KLM8/tYLhmzENJ1E8naEILRPyDbbV3BksdNbFmTECTNWwWsiB4ObCuQkOygqG
wYbJDnzSAAfDZGXZ78rt4+YcAP/RnsGIRtTMCq2G9SF45O5dX9fDRq3psSMYow1W3694jgFrNS5X
yyJ/THeHKsvXxW6b7rMiH2f5U7rJHpG4ESDdz/A2PDwRdmQnl87UM5OCex3UWnFmLp5QjTbtAPIx
PduHshcWPnxyg+1PJ5wBvrhRv/7wCQeLk+rugqulwLNc/if0K5GYsb1jmszGs8UkCn0itTrdxREN
w3EUhPO5T6xooXq5/TJpi1ur2cNGd1WqTiChI6/u+gMAAP//AwDfNKGTiQMAAA==
string: '{"address":{"id":"adr_512bdc91cbe811ec837dac1f6bc7b362","object":"Address","created_at":"2022-05-04T20:25:19+00:00","updated_at":"2022-05-04T20:25:19+00:00","name":null,"company":"EASYPOST","street1":"417
MONTGOMERY ST FL 5","street2":"","city":"SAN FRANCISCO","state":"CA","zip":"94104-1129","country":"US","phone":"4151234567","email":null,"mode":"test","carrier_facility":null,"residential":false,"federal_tax_id":null,"state_tax_id":null,"verifications":{"zip4":{"success":true,"errors":[{"code":"E.SECONDARY_INFORMATION.INVALID","field":"street2","message":"Invalid
secondary information(Apt/Suite#)","suggestion":null}],"details":null},"delivery":{"success":true,"errors":[{"code":"E.SECONDARY_INFORMATION.INVALID","field":"street2","message":"Invalid
secondary information(Apt/Suite#)","suggestion":null}],"details":{"latitude":37.79342,"longitude":-122.40288,"time_zone":"America/Los_Angeles"}}}}}'
headers:
cache-control:
- no-cache, no-store
content-encoding:
- gzip
content-length:
- '905'
content-type:
- application/json; charset=utf-8
etag:
- W/"e125f6fac47edaec1d6582bc01a06fc3"
- W/"00c792431fd886fc7da345bd52b8e0a7"
expires:
- '0'
location:
- /api/v2/addresses/adr_565f53beb6a411ecbd42ac1f6b0a0d1e
- /api/v2/addresses/adr_512bdc91cbe811ec837dac1f6bc7b362
pragma:
- no-cache
referrer-policy:
Expand All @@ -62,20 +56,20 @@ interactions:
x-download-options:
- noopen
x-ep-request-uuid:
- 6399b1b4624f33b4ff223076000381c5
- 62b330b76272e12fe786b82100161462
x-frame-options:
- SAMEORIGIN
x-node:
- bigweb4nuq
- bigweb3nuq
x-permitted-cross-domain-policies:
- none
x-proxied:
- intlb2nuq fde591f008
- extlb2nuq fde591f008
- extlb1nuq c51cdb8bf2
x-runtime:
- '0.052091'
- '0.051722'
x-version-label:
- easypost-202204071625-f7b25baf21-master
- easypost-202205041833-02730cc398-master
x-xss-protection:
- 1; mode=block
status:
Expand Down
32 changes: 13 additions & 19 deletions tests/cassettes/test_address_create_verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,23 @@ interactions:
uri: https://api.easypost.com/v2/addresses
response:
body:
string: !!binary |
H4sIAAAAAAAAA9SST4+bMBDFvwpyL62aZLHDn4QbyiYVUgJVSCtFVYUcPKSujImMWTUb7XfvmOz2
0FOv5QLzeG/889g3IgVJCBemCiPK5yyMThEPKIX6RHnDa9pEpzo+zSNGJqQ7/YTaoj8VwkDfo1Qb
4BZExZ3MfMamfjD14wNdJGGYBPFH3098H43DRfybUfMWSKIHpbB71164vmJinZbHz0V5QENvDYCl
KAY09nZFfvhU7Nb7o1cevM3WC/9YGFocorSuQ5nm3maf5qusXBWjB3lQX6VYPMsLfi4DilCUsqWL
dYO2xiW/lFhefnQaxjVDyuZBGMUoQsuleoNtO+EMFnrr4twYCabCGUo1EtxdODcpQFvJMdhw1cOE
NCDAcFVZ/qty53F3joB/aU9gZCNrbmWne5LcHHjg3v1Q1+5EEmsG7AjGdAarbzfcx4i1npXrVZE/
pvtjleWbYr9LD1mRz7L8a7rNHpG4kaDcZXgbHu4IO/KzS2f6iSspvB7qTgturp7UTWfaEeR9erEP
5SAtvPvgBjuczzgD/HGnfvk+IQIsTqp/FVytJO7l+j+h34jCjB0c0zyexct5wCZEdfr8Kk4pY7PA
Z4vFhFjZQvV8vzJpi6dW84dt11epPoOCnrzg8xsAAP//AwCnANTsfQMAAA==
string: '{"id":"adr_510262fdcbe811ec9ba6ac1f6bc72124","object":"Address","created_at":"2022-05-04T20:25:19+00:00","updated_at":"2022-05-04T20:25:19+00:00","name":null,"company":"EASYPOST","street1":"417
MONTGOMERY ST FL 5","street2":"","city":"SAN FRANCISCO","state":"CA","zip":"94104-1129","country":"US","phone":"4151234567","email":null,"mode":"test","carrier_facility":null,"residential":false,"federal_tax_id":null,"state_tax_id":null,"verifications":{"zip4":{"success":true,"errors":[{"code":"E.SECONDARY_INFORMATION.INVALID","field":"street2","message":"Invalid
secondary information(Apt/Suite#)","suggestion":null}],"details":null},"delivery":{"success":true,"errors":[{"code":"E.SECONDARY_INFORMATION.INVALID","field":"street2","message":"Invalid
secondary information(Apt/Suite#)","suggestion":null}],"details":{"latitude":37.79342,"longitude":-122.40288,"time_zone":"America/Los_Angeles"}}}}'
headers:
cache-control:
- no-cache, no-store
content-encoding:
- gzip
content-length:
- '893'
content-type:
- application/json; charset=utf-8
etag:
- W/"a15d88faf9f4a2f5317ef70e97be36d0"
- W/"c0e8584df6edd8c47e3c61df2fafddff"
expires:
- '0'
location:
- /api/v2/addresses/adr_561a3256b6a411ecb1afac1f6bc7b362
- /api/v2/addresses/adr_510262fdcbe811ec9ba6ac1f6bc72124
pragma:
- no-cache
referrer-policy:
Expand All @@ -62,20 +56,20 @@ interactions:
x-download-options:
- noopen
x-ep-request-uuid:
- 6399b1b1624f33b3ff22307500038190
- 62b330b76272e12fe786b82000161441
x-frame-options:
- SAMEORIGIN
x-node:
- bigweb8nuq
- bigweb5nuq
x-permitted-cross-domain-policies:
- none
x-proxied:
- intlb1nuq fde591f008
- extlb2nuq fde591f008
- extlb1nuq c51cdb8bf2
x-runtime:
- '0.051492'
- '0.043052'
x-version-label:
- easypost-202204071625-f7b25baf21-master
- easypost-202205041833-02730cc398-master
x-xss-protection:
- 1; mode=block
status:
Expand Down
32 changes: 12 additions & 20 deletions tests/cassettes/test_address_create_verify_strict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,22 @@ interactions:
uri: https://api.easypost.com/v2/addresses
response:
body:
string: !!binary |
H4sIAAAAAAAAA4yRW2/jIBCF/4rF6zpdIL4kfkPZVtqLkij2qlpVlYVh3KWycQS4ahv1v++QVH3Y
p/KC5/ibMwc4EaNJRaR2bZ7Dquc57wqZMQaqY+tcKtYXnSq7ZcFJSqbuEVRAXmjtwHuUlAMZQLcy
ypxyvqDZgpYNW1V5XmXlF0orShGcj/pzoJUjIPJDbH4m9V4cDrvbOGcaj9K+4I9rUf/Z7+oGRR8c
QGAoLlerpNndbuvr7bekbhKxbxJOPxCOSDQxITrUYpvcHMR2873e7M4MJkN9I7B4NUf8XGeMlgtW
lPQ8e7bBxc7fNZbHv5ONeP6xUIRRmoFUdh6GlIyTjkAAH2K7dM6Aa3upzHBOcKHwBo0GG4zExuBm
SEkPGpwc2iCf2/gwF/Cc7z/tCZzpjZLBTNaT6hRzZ3H3s1Lxad4dwbnJYXV3nxINAUP6i8VbrAeD
Pi+fbTuRAeeFOR5uWV6VZZ6zlAyTfXgXF4zzq+W6WJcpCWaE9vVyU2LEtEp+/TX5VtgHGMCTN1z/
AAAA//8DAL9iT39+AgAA
string: '{"id":"adr_5089554ccbe811ec833eac1f6bc7b362","object":"Address","created_at":"2022-05-04T20:25:18+00:00","updated_at":"2022-05-04T20:25:18+00:00","name":"JACK
SPARROW","company":"EASYPOST","street1":"388 TOWNSEND ST APT 20","street2":"","city":"SAN
FRANCISCO","state":"CA","zip":"94107-1670","country":"US","phone":"5555555555","email":null,"mode":"test","carrier_facility":null,"residential":true,"federal_tax_id":null,"state_tax_id":null,"verifications":{"zip4":{"success":true,"errors":[],"details":null},"delivery":{"success":true,"errors":[],"details":{"latitude":37.77551,"longitude":-122.39697,"time_zone":"America/Los_Angeles"}}}}'
headers:
cache-control:
- no-cache, no-store
content-encoding:
- gzip
content-length:
- '638'
content-type:
- application/json; charset=utf-8
etag:
- W/"46a84cdff613ae33b17054cf8e938831"
- W/"c6e8a2eecd3fff24b2ca9757bfaf800e"
expires:
- '0'
location:
- /api/v2/addresses/adr_55e8f252b6a411ecb195ac1f6bc7b362
- /api/v2/addresses/adr_5089554ccbe811ec833eac1f6bc7b362
pragma:
- no-cache
referrer-policy:
Expand All @@ -56,27 +50,25 @@ interactions:
- chunked
x-backend:
- easypost
x-canary:
- direct
x-content-type-options:
- nosniff
x-download-options:
- noopen
x-ep-request-uuid:
- 6399b1ae624f33b3ff2230720003816d
- 62b330b86272e12ee786b81d001613ec
x-frame-options:
- SAMEORIGIN
x-node:
- bigweb7nuq
- bigweb8nuq
x-permitted-cross-domain-policies:
- none
x-proxied:
- intlb2nuq fde591f008
- extlb2nuq fde591f008
- extlb1nuq c51cdb8bf2
x-runtime:
- '0.039667'
- '0.043825'
x-version-label:
- easypost-202204071625-f7b25baf21-master
- easypost-202205041833-02730cc398-master
x-xss-protection:
- 1; mode=block
status:
Expand Down
Loading

0 comments on commit e9f34a6

Please sign in to comment.