geeViz.eeAuth.tests.test_library

Tests for the geeViz.eeAuth library.

Covers the public API surface — anything users would import from geeViz.eeAuth.*. Internal behavior is mostly covered by the agent’s test suite (which exercises the same modules end-to-end).

Functions

test_agent_sa_registry_shim_still_works()

The agent's geeviz_agent.sa_registry module should re-export from geeViz.eeAuth.registry so existing imports keep working.

test_agent_workload_tags_shim_still_works()

test_build_proxy_router_is_mountable()

build_proxy_router should produce an APIRouter you can include in any FastAPI app at any prefix.

test_client_exports()

test_create_proxy_app_returns_fastapi()

create_proxy_app should produce a working FastAPI instance with the proxy mounted at the prefix and a root health check.

test_main_module_help_runs()

python -m geeViz.eeAuth --help should print usage without error.

test_proxy_rejects_unknown_tenant_when_no_default()

When no SA is registered, the proxy should 400 — never 500.

test_registry_exports()

test_registry_fallback_to_default_on_unknown_tenant()

test_registry_loads_from_env()

test_server_exports()

test_tags_exports_and_sanitize()

test_tenant_context_nested()

test_tenant_context_restores_on_exception()

test_tenant_context_sets_and_resets()

test_top_level_exports_present()

Every name in __init__.py's __all__ must be importable.