betamaxpy / betamax

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

Allow to record duplicated urls on a cassette #102

Closed yrobla closed 8 years ago

yrobla commented 8 years ago

Depending on the use case, it may be needed to record the content of same url different times. Currently only one url with the same match is allowed. This change proposes two things:

  1. If we are recording, do not query for matches, just record everything that comes.
  2. If we are consuming the cassette, consume each fixture once, by setting a used flag. This will allow to consume each result in order, and not duplicate.

Allow to record duplicated urls on a cassette

Depending on the use case, it may be needed to record the content of same url different times. Currently only one url with the same match is allowed. This change proposes two things:

  1. If we are recording, do not query for matches, just record everything that comes.
  2. If we are consuming the cassette, consume each fixture once, by setting a used flag. This will allow to consume each result in order, and not duplicate.

Fix tests and add new unit test for checking order

Fix tests for python 3.4

sigmavirus24 commented 8 years ago

Thanks @yrobla! :tada: