Home / File/ test_path.py — fastapi Source File

test_path.py — fastapi Source File

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

File python FastAPI Routing 2 imports 75 functions

Entity Profile

Dependency Diagram

graph LR
  114b7346_56f1_5baa_099f_1acd87f8d21f["test_path.py"]
  224633e5_139d_dee9_c17b_aeac8a2f6027["main.py"]
  114b7346_56f1_5baa_099f_1acd87f8d21f --> 224633e5_139d_dee9_c17b_aeac8a2f6027
  a7c04dee_ee23_5891_b185_47ff6bed036d["testclient.py"]
  114b7346_56f1_5baa_099f_1acd87f8d21f --> a7c04dee_ee23_5891_b185_47ff6bed036d
  style 114b7346_56f1_5baa_099f_1acd87f8d21f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from fastapi.testclient import TestClient

from .main import app

client = TestClient(app)


def test_text_get():
    response = client.get("/text")
    assert response.status_code == 200, response.text
    assert response.json() == "Hello World"


def test_nonexistent():
    response = client.get("/nonexistent")
    assert response.status_code == 404, response.text
    assert response.json() == {"detail": "Not Found"}


def test_path_foobar():
    response = client.get("/path/foobar")
    assert response.status_code == 200
    assert response.json() == "foobar"


def test_path_str_foobar():
    response = client.get("/path/str/foobar")
    assert response.status_code == 200
    assert response.json() == "foobar"


def test_path_str_42():
    response = client.get("/path/str/42")
    assert response.status_code == 200
    assert response.json() == "42"


def test_path_str_True():
    response = client.get("/path/str/True")
    assert response.status_code == 200
    assert response.json() == "True"


def test_path_int_foobar():
    response = client.get("/path/int/foobar")
    assert response.status_code == 422
    assert response.json() == {
        "detail": [
            {
                "type": "int_parsing",
                "loc": ["path", "item_id"],
                "msg": "Input should be a valid integer, unable to parse string as an integer",
                "input": "foobar",
            }
        ]
    }


def test_path_int_True():
    response = client.get("/path/int/True")
// ... (721 more lines)

Domain

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does test_path.py do?
test_path.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_path.py?
test_path.py defines 75 function(s): test_nonexistent, test_path_bool_0, test_path_bool_1, test_path_bool_42, test_path_bool_42_5, test_path_bool_False, test_path_bool_True, test_path_bool_false, test_path_bool_foobar, test_path_bool_true, and 65 more.
What does test_path.py depend on?
test_path.py imports 2 module(s): main.py, testclient.py.
Where is test_path.py in the architecture?
test_path.py is located at tests/test_path.py (domain: FastAPI, subdomain: Routing, directory: tests).

Analyze Your Own Codebase

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

Try Supermodel Free