STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_session_isolation Namespace Reference

Functions

Request _request (str|None email)
 _run (coro)
 test_distinct_users_get_distinct_sessions ()
 test_same_user_reuses_one_session ()
 test_dev_fallback_is_a_single_local_session ()
 test_ttl_eviction_recreates_a_fresh_session (monkeypatch)
 test_job_cap_is_three ()
 test_one_users_config_edit_does_not_touch_another ()
 test_optimizer_status_and_results_are_per_user ()
 test_stop_only_affects_the_callers_run ()
 test_controller_is_per_user ()

Detailed Description

Per-user live-state isolation for the Engine Design backend.

Two users connected at once must not share the live config, the optimizer job
state, or the controller. Identity is the ``X-Auth-Email`` header (Caddy in prod,
absent in dev -> ``local``). These tests drive the real dependency and endpoint
coroutines directly -- no HTTP client needed -- so they exercise exactly what
Caddy's forwarded header feeds into the app.

See backend/session.py for the mechanism.

Function Documentation

◆ _request()

◆ _run()

◆ test_controller_is_per_user()

test_session_isolation.test_controller_is_per_user ( )

Definition at line 152 of file test_session_isolation.py.

References _request(), and _run().

◆ test_dev_fallback_is_a_single_local_session()

test_session_isolation.test_dev_fallback_is_a_single_local_session ( )
No Caddy in dev -> no header -> everyone is `local`, one shared session,
with the default config loaded (the old single-user behaviour).

Definition at line 63 of file test_session_isolation.py.

References _request().

◆ test_distinct_users_get_distinct_sessions()

test_session_isolation.test_distinct_users_get_distinct_sessions ( )

Definition at line 50 of file test_session_isolation.py.

References _request().

◆ test_job_cap_is_three()

test_session_isolation.test_job_cap_is_three ( )

Definition at line 83 of file test_session_isolation.py.

◆ test_one_users_config_edit_does_not_touch_another()

test_session_isolation.test_one_users_config_edit_does_not_touch_another ( )

Definition at line 91 of file test_session_isolation.py.

References _request(), and _run().

◆ test_optimizer_status_and_results_are_per_user()

test_session_isolation.test_optimizer_status_and_results_are_per_user ( )

Definition at line 113 of file test_session_isolation.py.

References _request(), and _run().

◆ test_same_user_reuses_one_session()

test_session_isolation.test_same_user_reuses_one_session ( )

Definition at line 57 of file test_session_isolation.py.

References _request().

◆ test_stop_only_affects_the_callers_run()

test_session_isolation.test_stop_only_affects_the_callers_run ( )

Definition at line 131 of file test_session_isolation.py.

References _request(), and _run().

◆ test_ttl_eviction_recreates_a_fresh_session()

test_session_isolation.test_ttl_eviction_recreates_a_fresh_session ( monkeypatch)

Definition at line 73 of file test_session_isolation.py.