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

Suppress first request or mock a couple of requests from single cassette #43

Closed
lessless opened this issue Jan 19, 2016 · 3 comments
Closed

Comments

@lessless
Copy link

Hello,

The situation is that prior to performing request under test library must obtain a token from the service provider (do an OAuth authentication), which basically means that there will always be 2 requests.
Is it possible to ignore this first request or mock it within same cassette?

@lessless lessless changed the title ExVCR warm up? Suppress first request?.. Jan 19, 2016
@lessless lessless changed the title Suppress first request?.. Suppress first request or serve few requests from single cassette Jan 19, 2016
@lessless lessless changed the title Suppress first request or serve few requests from single cassette Suppress first request or mock a couple of requests from single cassette Jan 19, 2016
@parroty
Copy link
Owner

parroty commented Jan 19, 2016

Hello,

Is it possible to ignore this first request or mock it within same cassette?

Single cassette can contain multiple http requests and responses. When replaying, one response among multiple ones, will be returned based on the request parameters. The following is one example.

Does this cover your scenario?

I'm not so clear about "ignore this first request" scenario though. What would be the expected behavior when replaying for the first request?

@lessless
Copy link
Author

@parroty as you see topic changed a couple of times - it wasn't clear here as well and I just played with all possible options.
Multiple requests inside one use_cassette block totally covers my scenario. Thank you for the work!

@parroty
Copy link
Owner

parroty commented Jan 20, 2016

Understood, thanks for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants