-
Notifications
You must be signed in to change notification settings - Fork 12
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
Saving multiple queries on a single cassette #93
Comments
thanks for this @Rekyt having a look |
problem is right here https://github.com/ropensci/vcr/blob/master/R/cassette_class.R#L418 on first use of http_interactions:
- request:
method: get
uri: https://httpbin.org//status/404
body:
encoding: ''
string: ''
headers:
Accept: application/json, text/xml, application/xml, */*
response:
status:
status_code: 404
category: Client error
reason: Not Found
message: 'Client error: (404) Not Found'
headers:
connection: keep-alive
server: gunicorn/19.9.0
date: Thu, 07 Feb 2019 20:10:17 GMT
content-type: text/html; charset=utf-8
access-control-allow-origin: '*'
access-control-allow-credentials: 'true'
content-length: '0'
via: 1.1 vegur
body:
encoding: UTF-8
string: ''
recorded_at: 2019-02-07 20:10:17 GMT
recorded_with: vcr/0.2.2.9312, webmockr/0.3.1.9311 on 2nd it makes http_interactions:
- request:
method: get
uri: https://httpbin.org//status/404
body:
encoding: ''
string: ''
headers:
Accept: application/json, text/xml, application/xml, */*
response:
status: 404
headers:
connection: keep-alive
server: gunicorn/19.9.0
date: Thu, 07 Feb 2019 20:10:17 GMT
content-type: text/html; charset=utf-8
access-control-allow-origin: '*'
access-control-allow-credentials: 'true'
content-length: '0'
via: 1.1 vegur
body:
encoding: UTF-8
string: ''
recorded_at: 2019-02-07 20:10:30 GMT
recorded_with: vcr/0.2.2.9312, webmockr/0.3.1.9311 somehow replacing response:
status:
status_code: 404
category: Client error
reason: Not Found
message: 'Client error: (404) Not Found'
... with response:
status: 404
... In addition, it doesn't seem to happen if you only include 1 request, e.g,. use_cassette("multiple_queries3", {
g404 = GET("https://httpbin.org/status/404")
testthat::expect_equal(status_code(g404), 404)
}, record = "new_episodes") |
Seems to be fine when using |
related issue #94 may be at fault here, not sure yet |
@Rekyt i think it's fixed now. reinstall |
|
It works like a charm! Thank you so much @sckott ;) |
great, glad it's working for you |
cc @Bisaloo
We experience problems to record several request on a single
vcr
cassette.The two first times always work when using
record = new_episodes
however for the third call we get the following error (see reprex below):Are we recording the cassette in the intended way?
Thanks!
Related issue
#67
Reprex
Created on 2019-02-07 by the reprex package (v0.2.1)
Session info
The text was updated successfully, but these errors were encountered: