Skip to content

Commit ff03cea

Browse files
committed
Add more test cases on multiple matchers
1 parent af094e6 commit ff03cea

File tree

4 files changed

+949
-18
lines changed

4 files changed

+949
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<a href="https://travis-ci.com/Colin-b/pytest_httpx"><img alt="Build status" src="https://api.travis-ci.com/Colin-b/pytest_httpx.svg?branch=master"></a>
66
<a href="https://travis-ci.com/Colin-b/pytest_httpx"><img alt="Coverage" src="https://img.shields.io/badge/coverage-100%25-brightgreen"></a>
77
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
8-
<a href="https://travis-ci.com/Colin-b/pytest_httpx"><img alt="Number of tests" src="https://img.shields.io/badge/tests-79 passed-blue"></a>
8+
<a href="https://travis-ci.com/Colin-b/pytest_httpx"><img alt="Number of tests" src="https://img.shields.io/badge/tests-121 passed-blue"></a>
99
<a href="https://pypi.org/project/pytest-httpx/"><img alt="Number of downloads" src="https://img.shields.io/pypi/dm/pytest_httpx"></a>
1010
</p>
1111

pytest_httpx/_httpx_mock.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(
4646
):
4747
self.nb_calls = 0
4848
self.url = url
49-
self.method = method
49+
self.method = method.upper() if method else method
5050
self.headers = match_headers
5151
self.content = match_content
5252

@@ -77,7 +77,7 @@ def _method_match(self, request: httpx.Request) -> bool:
7777
if not self.method:
7878
return True
7979

80-
return request.method == self.method.upper()
80+
return request.method == self.method
8181

8282
def _headers_match(self, request: httpx.Request) -> bool:
8383
if not self.headers:
@@ -368,4 +368,4 @@ def to_response(
368368
else []
369369
)
370370
body = stream(data=data, files=files, json=json, boundary=boundary)
371-
return (http_version.encode(), status_code, b"", headers, body)
371+
return http_version.encode(), status_code, b"", headers, body

0 commit comments

Comments
 (0)