Closed ahl closed 1 year ago
Hi @ahl ! If a manual removal is sufficient for you, you could use mock1.delete()
, like here: https://github.com/alexliesenfeld/httpmock/blob/d87ab088fff6c5f2e2aacf8083874f357111b1cd/tests/examples/delete_mock_tests.rs#L27
I noticed Mock::delete
but the situation we're considering basically looks like this:
let mock1 = server.mock(...); // respond with transient failure
let mock2 = server.mock(...); // respond with success
operation_that_should_retry_failed_queries();
So we don't (I think?) have an opportunity to call delete
.
@alexliesenfeld any more thoughts on this? Thanks.
Sure, I would accept a PR! However, I think for your specific use case it could be an option to use Mock::assert_hits
(see docs here).
This issue is stale because it has been open for 30 days with no activity.
I'll work on a PR; assert_hits doesn't do what we have in mind here.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Again: love this crate.
I've found some situations where I would like a
Then
to specify a response (in my case once) and then for a subsequent call with the same parameters to get a different response. One way I could imagine doing it is like this:Happy to submit a PR if this seems reasonable. Thanks.