Home / Function/ test_token_no_sub() — fastapi Function Reference

test_token_no_sub() — fastapi Function Reference

Architecture documentation for the test_token_no_sub() function in test_tutorial004.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  ae029f52_b0b7_82eb_9377_a51a952c52b7["test_token_no_sub()"]
  99a6e52c_39c3_5825_2899_8b0fa980bff4["test_tutorial004.py"]
  ae029f52_b0b7_82eb_9377_a51a952c52b7 -->|defined in| 99a6e52c_39c3_5825_2899_8b0fa980bff4
  style ae029f52_b0b7_82eb_9377_a51a952c52b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_tutorial/test_security/test_tutorial004.py lines 116–127

def test_token_no_sub(mod: ModuleType):
    client = TestClient(mod.app)

    response = client.get(
        "/users/me",
        headers={
            "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiZm9vIn0.9ynBhuYb4e6aW3oJr_K_TBgwcMTDpRToQIE25L57rOE"
        },
    )
    assert response.status_code == 401, response.text
    assert response.json() == {"detail": "Could not validate credentials"}
    assert response.headers["WWW-Authenticate"] == "Bearer"

Domain

Subdomains

Frequently Asked Questions

What does test_token_no_sub() do?
test_token_no_sub() is a function in the fastapi codebase, defined in tests/test_tutorial/test_security/test_tutorial004.py.
Where is test_token_no_sub() defined?
test_token_no_sub() is defined in tests/test_tutorial/test_security/test_tutorial004.py at line 116.

Analyze Your Own Codebase

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

Try Supermodel Free