Home / File/ test_tutorial001_01.py — fastapi Source File

test_tutorial001_01.py — fastapi Source File

Architecture documentation for test_tutorial001_01.py, a python file in the fastapi codebase. 2 imports, 0 dependents.

File python FastAPI Routing 2 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  4477fe8a_6591_272d_ce7b_6595169f7a45["test_tutorial001_01.py"]
  a7c04dee_ee23_5891_b185_47ff6bed036d["testclient.py"]
  4477fe8a_6591_272d_ce7b_6595169f7a45 --> a7c04dee_ee23_5891_b185_47ff6bed036d
  30841324_589b_30c3_f1e0_d587c7062d9b["tutorial001_01_py39.py"]
  4477fe8a_6591_272d_ce7b_6595169f7a45 --> 30841324_589b_30c3_f1e0_d587c7062d9b
  style 4477fe8a_6591_272d_ce7b_6595169f7a45 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from fastapi.testclient import TestClient

from docs_src.behind_a_proxy.tutorial001_01_py39 import app

client = TestClient(
    app,
    base_url="https://example.com",
    follow_redirects=False,
)


def test_redirect() -> None:
    response = client.get("/items")
    assert response.status_code == 307
    assert response.headers["location"] == "https://example.com/items/"


def test_no_redirect() -> None:
    response = client.get("/items/")
    assert response.status_code == 200
    assert response.json() == ["plumbus", "portal gun"]

Domain

Subdomains

Frequently Asked Questions

What does test_tutorial001_01.py do?
test_tutorial001_01.py is a source file in the fastapi codebase, written in python. It belongs to the FastAPI domain, Routing subdomain.
What functions are defined in test_tutorial001_01.py?
test_tutorial001_01.py defines 2 function(s): test_no_redirect, test_redirect.
What does test_tutorial001_01.py depend on?
test_tutorial001_01.py imports 2 module(s): testclient.py, tutorial001_01_py39.py.
Where is test_tutorial001_01.py in the architecture?
test_tutorial001_01.py is located at tests/test_tutorial/test_behind_a_proxy/test_tutorial001_01.py (domain: FastAPI, subdomain: Routing, directory: tests/test_tutorial/test_behind_a_proxy).

Analyze Your Own Codebase

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

Try Supermodel Free