betamaxpy / betamax

A VCR imitation designed only for python-requests.
https://betamax.readthedocs.io/en/latest/
Other
566 stars 62 forks source link

Allow merging of cassette placeholder overrides #98

Closed ekohl closed 8 years ago

ekohl commented 8 years ago

This changes the cassette placeholders parameter to always use the default cassette options and then replace any matching keys. To do so it first replaces the storage of placeholders from a list of dicts to a dict.

It maintains API compatibility so users don't have to modify their tests, but because of the merging it could invalidate existing cassettes.

Another issue is that Cassette.default_cassette_options is a class variable meaning you can't remove any global config keys. This could be solved by moving the defaults to the configuration and passing it in the constructor.

Closes GH-97

sigmavirus24 commented 8 years ago

I rebased and merged this. Thanks @ekohl

ekohl commented 8 years ago

Thanks!