Skip to content

More patterns and lookups #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 30, 2020
Merged

More patterns and lookups #99

merged 3 commits into from
Oct 30, 2020

Conversation

lundberg
Copy link
Owner

Adds:

  • headers pattern
  • cookies pattern
  • contains lookup
  • in lookup

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@codecov-io
Copy link

codecov-io commented Oct 30, 2020

Codecov Report

Merging #99 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #99   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines         1860      1921   +61     
  Branches       141       151   +10     
=========================================
+ Hits          1860      1921   +61     
Impacted Files Coverage Δ
respx/patterns.py 100.00% <100.00%> (ø)
respx/router.py 100.00% <100.00%> (ø)
respx/types.py 100.00% <100.00%> (ø)
tests/test_api.py 100.00% <100.00%> (ø)
tests/test_patterns.py 100.00% <100.00%> (ø)
tests/test_router.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44f4b70...faba946. Read the comment docs.

@lundberg lundberg merged commit 358b3f7 into master Oct 30, 2020
@lundberg lundberg deleted the more-patterns-and-lookups branch October 30, 2020 14:19
@lundberg lundberg mentioned this pull request Oct 30, 2020
5 tasks
lundberg added a commit that referenced this pull request Nov 9, 2020
Added
- Added `respx.route(...)` with enhanced request pattern matching. (PR #96)
- Added support for AND/OR when request pattern matching. (PR #96)
- Added support for adding responses to a route using % operator. (PR #96)
- Added support for both `httpx.Response` and `MockResponse`. (PR #96)
- Enhanced Route (RequestPattern) with `.respond(...)` response details. (PR #96)
- Enhanced Route (RequestPattern) with `.pass_through()`. (PR #96)
- Add support for using route as side effect decorator. (PR #98)
- Add `headers` and `cookies` patterns. (PR #99)
- Add `contains` and `in` lookups. (PR #99)
- Introduced Route `.mock(...)` in favour of callbacks. (PR #101)
- Introduced Route `.return_value` and `.side_effect` setters. (PR #101)

Changed
- Deprecated mixing of request pattern and response details in all API's. (PR #96)
- Deprecated passing http method as arg in `respx.add` in favour of `method=`. (PR #96)
- Deprecated `alias=...` in favour of `name=...` when adding routes. (PR #96)
- Deprecated `respx.aliases` in favour of `respx.routes`. (PR #96)
- Deprecated `RequestPattern` in favour of `Route`. (PR #96)
- Deprecated `ResponseTemplate` in favour of `MockResponse`. (PR #96)
- Deprecated `pass_through=` in HTTP method API's (PR #96)
- Deprecated `response` arg in side effects (callbacks). (PR #97)
- Stacked responses are now recorded on same route calls. (PR #96)
- Pass-through routes no longer capture real response in call stats. (PR #97)
- Stacked responses no longer keeps and repeats last response. (PR #101)

Removed
- Removed support for regex `base_url`. (PR #96)
- Dropped support for `async` side effects (callbacks). (PR #97)
- Dropped support for mixing side effect (callback) and response details. (PR #97)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants