Better tests directory structure (#2231)

This commit is contained in:
Ayaz Salikhov
2025-02-21 17:46:43 +00:00
committed by GitHub
parent 80f4426b8e
commit 165bbc1e71
67 changed files with 174 additions and 148 deletions

View File

@@ -0,0 +1,31 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import logging
import secrets
import time
import requests
from tests.utils.find_free_port import find_free_port
from tests.utils.tracked_container import TrackedContainer
LOGGER = logging.getLogger(__name__)
def check_pluto_proxy(
container: TrackedContainer, http_client: requests.Session
) -> None:
host_port = find_free_port()
token = secrets.token_hex()
container.run_detached(
command=[
"start-notebook.py",
f"--IdentityProvider.token={token}",
],
ports={"8888/tcp": host_port},
)
# Give the server a bit of time to start
time.sleep(2)
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"