pook icon indicating copy to clipboard operation
pook copied to clipboard

HTTP traffic mocking and testing made easy in Python

Results 22 pook issues
Sort by recently updated
recently updated
newest added

A possible interface implementation: ```python def matcher(request, mock): return request.url.path == '/v1/foo' pook.get('api.server.com').match_func(matcher).match_func(matcher) ``` Overload method for specific matcher function usage: ```python def json_matcher(body): return body == '{"foo": true}' pook.get('api.server.com').body(json_matcher)...

enhancement

Persistent mock definition are reused across volatile mock instances via inheritance. Exposes mock request/response chainable interfaces: ```python pook.defaults.request.headers({'Client': 'pook/0.1.6'}) pook.defaults.response.headers({'Server': 'pook/0.1.6'}) ```

enhancement

Limit outgoing bytes in mocked HTTP responses. This is a nice-to-have feature.

enhancement

Some "unlucky" people still relies on it. This is purely a nice-to-have feature. PR are very welcome.

enhancement

`Mock::body` ignores the `binary` parameter passed to it and always passes `binary=False` to the matcher constructor. https://github.com/h2non/pook/blob/ff30ca754b7569245640e593ffc7389c91a3e500/src/pook/mock.py#L414

bug

Pook has a feature that allows passing specially formatted strings, which pook interprets as a regex pattern to be parsed during matching. In all cases where this feature is supported,...

enhancement

Query params are always strings and should be compared as such, even if passed as something else to the mock constructor. For example, the following should work: ```py pook.get("https://example.com").params({"x": 1})...

bug

Implements the deprecation warning described in #128. The PR is still a draft as it needs release notes.

## How to prepare your code for this change > **Note** > > The version with the deprecation notice has not yet been released, this copy is here just to...

bug