kevin1024 / vcrpy

Automatically mock your HTTP interactions to simplify and speed up testing
MIT License
2.72k stars 389 forks source link

Allow filter PUT data parameters when using JSON #328

Open eliasdorneles opened 7 years ago

eliasdorneles commented 7 years ago

Currently it's possible to set parameters to be filtered of the request body using filter_post_data_parameters.

It would be nice to support the same for PUT requests as well.

eliasdorneles commented 7 years ago

Relevant code: https://github.com/kevin1024/vcrpy/blob/master/vcr/filters.py#L86

simon-weber commented 5 years ago

I just ran into this and was surprised PUTs weren't handled in the same way as POSTs.

As far as I can tell the easiest workaround is to hook up a custom filter that temporarily modifies PUTs to POSTs and calls replace_post_data_parameters on them. Anyone have a better idea?

neozenith commented 4 years ago

A lot of changes have happened to VCRpy since this ticket was opened. As this ticket has become stale and we have a lot of old tickets that need to be groomed, I'm closing this for now to make it easier to see what is still relevant.

However if it is still needed, please feel free to re-open or create a new ticket.

Thanks! 🙏

eliasdorneles commented 4 years ago

Well, I haven't tried yet the code on master, but judging from the code, the issue I described is still there. This makes it hard to test API calls to PUT requests.

Personally, I've started recently to use HTTP mocks recently, mocking at HTTP layer, because of limitations like these that I hit w/ the VCR/cassettes approach.

neozenith commented 4 years ago

Hi, I just wanted to update active PRs and issues to let you know I will no longer be an active maintainer on this project.

I recently changed jobs where I no longer use VCRpy or Python at all so I don't have the bandwidth anymore. I won't be monitoring issues or PRs either.

I will have to delegate to other maintainers or ask for some contributors to step up.

I know the Azure CLI uses VCRpy so it would be nice if they could spare some sprint time to maintain this project as it was invaluable in our CI when I was using it.

Kind regards, Josh