-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put pluto test in one common file (#1934)
- Loading branch information
1 parent
39582f7
commit 2edc0fe
Showing
3 changed files
with
21 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
import requests | ||
|
||
from tests.conftest import TrackedContainer | ||
from tests.pluto_check import check_pluto_proxy | ||
|
||
|
||
def test_pluto_proxy( | ||
container: TrackedContainer, http_client: requests.Session | ||
) -> None: | ||
"""Pluto proxy starts Pluto correctly""" | ||
check_pluto_proxy(container, http_client) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,13 @@ | ||
import logging | ||
import secrets | ||
import time | ||
|
||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
import requests | ||
|
||
from tests.conftest import TrackedContainer, find_free_port | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
from tests.conftest import TrackedContainer | ||
from tests.pluto_check import check_pluto_proxy | ||
|
||
|
||
def test_pluto_proxy( | ||
container: TrackedContainer, http_client: requests.Session | ||
) -> None: | ||
"""Pluto proxy starts Pluto correctly""" | ||
host_port = find_free_port() | ||
token = secrets.token_hex() | ||
container.run_detached( | ||
command=[ | ||
"start.sh", | ||
"jupyter", | ||
"lab", | ||
"--port=8888", | ||
f"--LabApp.token={token}", | ||
], | ||
ports={"8888/tcp": host_port}, | ||
) | ||
# Give the server a bit of time to start | ||
time.sleep(3) | ||
resp = http_client.get(f"http://localhost:{host_port}/pluto?token={token}") | ||
resp.raise_for_status() | ||
assert "Pluto.jl notebooks" in resp.text, "Pluto.jl text not found in /pluto page" | ||
check_pluto_proxy(container, http_client) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters