Skip to content

Commit 11d2403

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2639b53 commit 11d2403

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

Diff for: tests/resources/jupyter_server_config.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,20 @@ def _get_path(*args):
1616
def get_command(port):
1717
return [sys.executable, _get_path("httpinfo.py"), f"--port={port}"]
1818

19+
1920
def get_command_unix_socket(unix_socket):
2021
return [sys.executable, _get_path("httpinfo.py"), f"--unix-socket={unix_socket}"]
2122

23+
2224
def get_environment(base_url):
23-
return {
24-
"JUPYTERLAB_BASE_URL": base_url,
25-
"MYVAR": "String with escaped {{var}}"
26-
}
25+
return {"JUPYTERLAB_BASE_URL": base_url, "MYVAR": "String with escaped {{var}}"}
26+
2727

2828
def mappathf(path):
2929
p = path + "mapped"
3030
return p
3131

32+
3233
def request_headers_overwrite():
3334
return {
3435
"X-Custom-Header": "pytest-23456",
@@ -93,8 +94,8 @@ def cats_only(response, path):
9394
"command": [sys.executable, _get_path("httpinfo.py"), "--port={port}"],
9495
"environment": {
9596
"JUPYTERLAB_BASE_URL": "{base_url}",
96-
"MYVAR": "String with escaped {{var}}"
97-
}
97+
"MYVAR": "String with escaped {{var}}",
98+
},
9899
},
99100
"python-http-callable-environment": {
100101
"command": [sys.executable, _get_path("httpinfo.py"), "--port={port}"],

Diff for: tests/test_proxies.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ def test_server_proxy_port_non_service_rewrite_response(
284284
s = r.read().decode("ascii")
285285
assert s.startswith("GET /foo?token=")
286286

287+
287288
def test_server_proxy_command_callable(
288289
a_server_port_and_token: Tuple[int, str]
289290
) -> None:
@@ -336,7 +337,9 @@ def test_server_proxy_mappath_callable(
336337
assert "X-Proxycontextpath: /python-http-callable-mappath\n" in s
337338

338339

339-
@pytest.mark.parametrize("name", ["python-http-environment", "python-http-callable-environment"])
340+
@pytest.mark.parametrize(
341+
"name", ["python-http-environment", "python-http-callable-environment"]
342+
)
340343
def test_server_proxy_environment(
341344
name: str, a_server_port_and_token: Tuple[int, str]
342345
) -> None:
@@ -349,8 +352,12 @@ def test_server_proxy_environment(
349352
assert f"X-Proxycontextpath: /{name}\n" in s
350353

351354

352-
@pytest.mark.parametrize("name", ["python-http-request-headers", "python-http-callable-request-headers"])
353-
def test_server_proxy_request_headers(name, a_server_port_and_token: Tuple[int, str]) -> None:
355+
@pytest.mark.parametrize(
356+
"name", ["python-http-request-headers", "python-http-callable-request-headers"]
357+
)
358+
def test_server_proxy_request_headers(
359+
name, a_server_port_and_token: Tuple[int, str]
360+
) -> None:
354361
PORT, TOKEN = a_server_port_and_token
355362
r = request_get(PORT, f"/{name}/", TOKEN, host="127.0.0.1")
356363
assert r.code == 200

0 commit comments

Comments
 (0)