Home / Function/ test_security_scopes_sub_dependency_caching() — fastapi Function Reference

test_security_scopes_sub_dependency_caching() — fastapi Function Reference

Architecture documentation for the test_security_scopes_sub_dependency_caching() function in test_security_scopes_sub_dependency.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  daf3923f_9311_1db4_792e_6a9cf53cf0f6["test_security_scopes_sub_dependency_caching()"]
  31e6d116_fac5_2949_d314_49a3be00eaa8["test_security_scopes_sub_dependency.py"]
  daf3923f_9311_1db4_792e_6a9cf53cf0f6 -->|defined in| 31e6d116_fac5_2949_d314_49a3be00eaa8
  style daf3923f_9311_1db4_792e_6a9cf53cf0f6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_security_scopes_sub_dependency.py lines 77–107

def test_security_scopes_sub_dependency_caching(
    client: TestClient, call_counts: dict[str, int]
):
    response = client.get("/")

    assert response.status_code == 200
    assert call_counts["get_db_session"] == 1
    assert call_counts["get_current_user"] == 2
    assert call_counts["get_user_me"] == 2
    assert call_counts["get_user_items"] == 1
    assert response.json() == {
        "user_me": {
            "user_me": "user_me_1",
            "current_user": {
                "user": "user_1",
                "scopes": ["me"],
                "db_session": "db_session_1",
            },
        },
        "user_items": {
            "user_items": "user_items_1",
            "user_me": {
                "user_me": "user_me_2",
                "current_user": {
                    "user": "user_2",
                    "scopes": ["items", "me"],
                    "db_session": "db_session_1",
                },
            },
        },
    }

Domain

Subdomains

Frequently Asked Questions

What does test_security_scopes_sub_dependency_caching() do?
test_security_scopes_sub_dependency_caching() is a function in the fastapi codebase, defined in tests/test_security_scopes_sub_dependency.py.
Where is test_security_scopes_sub_dependency_caching() defined?
test_security_scopes_sub_dependency_caching() is defined in tests/test_security_scopes_sub_dependency.py at line 77.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free