pnuckowski / aioresponses

Aioresponses is a helper for mock/fake web requests in python aiohttp package.
MIT License
513 stars 86 forks source link

`repeat` option in get(), post(), etc. also accept int #234

Open markuspinter opened 1 year ago

markuspinter commented 1 year ago

Hi! I just played around with aioresponse a bit and recognized something: A nice feature would be to make a response repeatable for a given amount of time, e.g.

mock_aioresponse.get(<url>, status=401, body=<error_response>, repeat=3)
mock_aioresponse.get(<url>, status=200, body=<success_response>)

so one doesn't need to copy paste the same call 3 times and then queue another one.

Thank you in advance!