test_tutorial001.py — fastapi Source File
Architecture documentation for test_tutorial001.py, a python file in the fastapi codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 2355bfdc_648a_591d_bfb5_a167c787264d["test_tutorial001.py"] af9b440f_13c4_d91e_f8ae_bfe199b060d2["os"] 2355bfdc_648a_591d_bfb5_a167c787264d --> af9b440f_13c4_d91e_f8ae_bfe199b060d2 879863b9_0db7_67c9_55cb_81a43a46d5ca["shutil"] 2355bfdc_648a_591d_bfb5_a167c787264d --> 879863b9_0db7_67c9_55cb_81a43a46d5ca a7c04dee_ee23_5891_b185_47ff6bed036d["testclient.py"] 2355bfdc_648a_591d_bfb5_a167c787264d --> a7c04dee_ee23_5891_b185_47ff6bed036d ddb65462_ccfc_4a35_05fd_db741d5095e6["tutorial001_py39.py"] 2355bfdc_648a_591d_bfb5_a167c787264d --> ddb65462_ccfc_4a35_05fd_db741d5095e6 style 2355bfdc_648a_591d_bfb5_a167c787264d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import os
import shutil
from fastapi.testclient import TestClient
def test_main():
if os.path.isdir("./static"): # pragma: nocover
shutil.rmtree("./static")
if os.path.isdir("./templates"): # pragma: nocover
shutil.rmtree("./templates")
shutil.copytree("./docs_src/templates/templates/", "./templates")
shutil.copytree("./docs_src/templates/static/", "./static")
from docs_src.templates.tutorial001_py39 import app
client = TestClient(app)
response = client.get("/items/foo")
assert response.status_code == 200, response.text
assert (
b'<h1><a href="http://testserver/items/foo">Item ID: foo</a></h1>'
in response.content
)
response = client.get("/static/styles.css")
assert response.status_code == 200, response.text
assert b"color: green;" in response.content
shutil.rmtree("./templates")
shutil.rmtree("./static")
Domain
Subdomains
Functions
Dependencies
- os
- shutil
- testclient.py
- tutorial001_py39.py
Source
Frequently Asked Questions
What does test_tutorial001.py do?
test_tutorial001.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_tutorial001.py?
test_tutorial001.py defines 1 function(s): test_main.
What does test_tutorial001.py depend on?
test_tutorial001.py imports 4 module(s): os, shutil, testclient.py, tutorial001_py39.py.
Where is test_tutorial001.py in the architecture?
test_tutorial001.py is located at tests/test_tutorial/test_templates/test_tutorial001.py (domain: FastAPI, subdomain: Applications, directory: tests/test_tutorial/test_templates).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free