mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-15 14:02:58 +00:00
Choose random host port in tests
This commit is contained in:
@@ -10,7 +10,8 @@ def test_secured_server(
|
||||
container: TrackedContainer, http_client: requests.Session
|
||||
) -> None:
|
||||
"""Notebook server should eventually request user login."""
|
||||
container.run_detached()
|
||||
resp = http_client.get("http://localhost:8888")
|
||||
container.run_detached(ports={"8888/tcp": None})
|
||||
host_port = container.get_host_port("8888/tcp")
|
||||
resp = http_client.get("http://localhost:" + host_port)
|
||||
resp.raise_for_status()
|
||||
assert "login_submit" in resp.text, "User login not requested"
|
||||
|
Reference in New Issue
Block a user