Home / File/ test_tutorial002.py — fastapi Source File

test_tutorial002.py — fastapi Source File

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

File python FastAPI Applications 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  a8783e5d_1012_2aa0_e8e7_e51eb2369bee["test_tutorial002.py"]
  a7c04dee_ee23_5891_b185_47ff6bed036d["testclient.py"]
  a8783e5d_1012_2aa0_e8e7_e51eb2369bee --> a7c04dee_ee23_5891_b185_47ff6bed036d
  dd3c438d_b6cb_7cd8_19a0_9f941f6a2834["tutorial002_py39.py"]
  a8783e5d_1012_2aa0_e8e7_e51eb2369bee --> dd3c438d_b6cb_7cd8_19a0_9f941f6a2834
  style a8783e5d_1012_2aa0_e8e7_e51eb2369bee fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from fastapi.testclient import TestClient

from docs_src.advanced_middleware.tutorial002_py39 import app


def test_middleware():
    client = TestClient(app, base_url="http://example.com")
    response = client.get("/")
    assert response.status_code == 200, response.text
    client = TestClient(app, base_url="http://subdomain.example.com")
    response = client.get("/")
    assert response.status_code == 200, response.text
    client = TestClient(app, base_url="http://invalidhost")
    response = client.get("/")
    assert response.status_code == 400, response.text

Domain

Subdomains

Functions

Frequently Asked Questions

What does test_tutorial002.py do?
test_tutorial002.py is a source file in the fastapi codebase, written in python. It belongs to the FastAPI domain, Applications subdomain.
What functions are defined in test_tutorial002.py?
test_tutorial002.py defines 1 function(s): test_middleware.
What does test_tutorial002.py depend on?
test_tutorial002.py imports 2 module(s): testclient.py, tutorial002_py39.py.
Where is test_tutorial002.py in the architecture?
test_tutorial002.py is located at tests/test_tutorial/test_advanced_middleware/test_tutorial002.py (domain: FastAPI, subdomain: Applications, directory: tests/test_tutorial/test_advanced_middleware).

Analyze Your Own Codebase

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

Try Supermodel Free