http-mock-adapter
http-mock-adapter copied to clipboard
Allow timeout simulations in replies
The current implementation of the http_mock_adapter
library provides a convenient way to mock server responses with the delay
parameter in the MockServer
reply. However, it lacks the ability to simulate connection, receive, or send timeouts, limiting its usefulness in testing scenarios that involve timeout-related behaviors.
Feature Request:
It would be great to extend the functionality of the MockServer
to include the ability to simulate connection, receive, and send timeouts explicitly. This enhancement will enable users to test and verify how their code handles different timeout scenarios, leading to more comprehensive and robust test coverage.
The suggested enhancement should allow users to specify connection, receive or send delay parameters configuration, which could be used to reflect timeouts defined in the Dio instance options.
Expected Outcome: With this enhancement, users can precisely control and simulate various timeout scenarios during testing, ensuring that their code behaves correctly in real-world networking conditions.