mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Applied Black
This commit is contained in:
parent
ef2ecc1b89
commit
8e8fc5cee5
2 changed files with 5 additions and 10 deletions
|
|
@ -92,10 +92,7 @@ class Request:
|
||||||
@property
|
@property
|
||||||
def full_path(self):
|
def full_path(self):
|
||||||
qs = self.query_string
|
qs = self.query_string
|
||||||
return "{}{}".format(
|
return "{}{}".format(self.path, ("?" + qs) if qs else "")
|
||||||
self.path,
|
|
||||||
('?' + qs) if qs else ''
|
|
||||||
)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def args(self):
|
def args(self):
|
||||||
|
|
|
||||||
|
|
@ -92,12 +92,10 @@ def test_request_url_vars():
|
||||||
).url_vars
|
).url_vars
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
@pytest.mark.parametrize("path,query_string,expected_full_path", [
|
"path,query_string,expected_full_path",
|
||||||
("/", "", "/"),
|
[("/", "", "/"), ("/", "foo=bar", "/?foo=bar"), ("/foo", "bar", "/foo?bar")],
|
||||||
("/", "foo=bar", "/?foo=bar"),
|
)
|
||||||
("/foo", "bar", "/foo?bar")
|
|
||||||
])
|
|
||||||
def test_request_properties(path, query_string, expected_full_path):
|
def test_request_properties(path, query_string, expected_full_path):
|
||||||
scope = {
|
scope = {
|
||||||
"http_version": "1.1",
|
"http_version": "1.1",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue