Skip to content

Commit 83bb7cb

Browse files
committed
pytest-httpserver: reformat code
Add whitespaces according to flake8, remove unused imports.
1 parent 650a938 commit 83bb7cb

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

pytest_httpserver/httpserver.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ class QueryMatcher(abc.ABC):
133133
get_comparing_values should return a 2-element tuple whose elements will
134134
be compared.
135135
"""
136+
136137
def match(self, request_query_string: bytes) -> bool:
137138
values = self.get_comparing_values(request_query_string)
138139
return values[0] == values[1]
@@ -141,10 +142,12 @@ def match(self, request_query_string: bytes) -> bool:
141142
def get_comparing_values(self, request_query_string: bytes) -> tuple:
142143
pass
143144

145+
144146
class StringQueryMatcher(QueryMatcher):
145147
"""
146148
Matches a query for a string or bytes specified
147149
"""
150+
148151
def __init__(self, query_string: Union[bytes, str]):
149152
"""
150153
:param query_string: the query string will be compared to this string or bytes.
@@ -196,6 +199,7 @@ class BooleanQueryMatcher(QueryMatcher):
196199
"""
197200
Matches the query depending on the boolean value
198201
"""
202+
199203
def __init__(self, result: bool):
200204
"""
201205
:param result: if this parameter is true, the query match will be always

tests/test_querystring.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import requests
2-
from pytest import approx, raises
32

43
from pytest_httpserver import HTTPServer
54

@@ -13,6 +12,7 @@ def test_querystring_str(httpserver: HTTPServer):
1312
assert response.text == "example_response"
1413
assert response.status_code == 200
1514

15+
1616
def test_querystring_bytes(httpserver: HTTPServer):
1717
httpserver.expect_request("/foobar", query_string=b"foo=bar", method="GET").respond_with_data(
1818
"example_response"
@@ -22,6 +22,7 @@ def test_querystring_bytes(httpserver: HTTPServer):
2222
assert response.text == "example_response"
2323
assert response.status_code == 200
2424

25+
2526
def test_querystring_dict(httpserver: HTTPServer):
2627
httpserver.expect_request("/foobar", query_string={"k1": "v1", "k2": "v2"}, method="GET").respond_with_data(
2728
"example_response"

tests/test_ssl.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
import os
44
from os.path import join as pjoin
55

6-
import pytest
76
import requests
8-
from werkzeug.wrappers import Response
9-
107
from pytest_httpserver import HTTPServer
118

129
test_dir = os.path.dirname(os.path.realpath(__file__))

0 commit comments

Comments
 (0)