Home / File/ test_tutorial004.py — fastapi Source File

test_tutorial004.py — fastapi Source File

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

File python FastAPI Applications 7 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  401a7ccf_6be2_fdf3_5881_3b23708d7133["test_tutorial004.py"]
  83e01a9c_50a9_bec9_6f86_8e729106de01["importlib"]
  401a7ccf_6be2_fdf3_5881_3b23708d7133 --> 83e01a9c_50a9_bec9_6f86_8e729106de01
  c1ef60e8_e635_2e82_29e5_a79e03e975d6["json"]
  401a7ccf_6be2_fdf3_5881_3b23708d7133 --> c1ef60e8_e635_2e82_29e5_a79e03e975d6
  b3e303a2_3f2d_638d_930c_3a5dcc2f5a42["pathlib"]
  401a7ccf_6be2_fdf3_5881_3b23708d7133 --> b3e303a2_3f2d_638d_930c_3a5dcc2f5a42
  d1bf66df_8a92_7a7c_dab4_0865060effa4["unittest.mock"]
  401a7ccf_6be2_fdf3_5881_3b23708d7133 --> d1bf66df_8a92_7a7c_dab4_0865060effa4
  a7f4e7b0_9725_db90_5cbc_7ca8211b323a["inline_snapshot"]
  401a7ccf_6be2_fdf3_5881_3b23708d7133 --> a7f4e7b0_9725_db90_5cbc_7ca8211b323a
  7e9b1814_ed8a_0c8b_d09a_46a3529af449["__init__.py"]
  401a7ccf_6be2_fdf3_5881_3b23708d7133 --> 7e9b1814_ed8a_0c8b_d09a_46a3529af449
  eb3120b2_9b88_fe3b_5775_676182851d39["tutorial003_py39.py"]
  401a7ccf_6be2_fdf3_5881_3b23708d7133 --> eb3120b2_9b88_fe3b_5775_676182851d39
  style 401a7ccf_6be2_fdf3_5881_3b23708d7133 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import importlib
import json
import pathlib
from unittest.mock import patch

from inline_snapshot import snapshot

from docs_src.generate_clients import tutorial003_py39


def test_remove_tags(tmp_path: pathlib.Path):
    tmp_file = tmp_path / "openapi.json"
    openapi_json = tutorial003_py39.app.openapi()
    tmp_file.write_text(json.dumps(openapi_json))

    with patch("pathlib.Path", return_value=tmp_file):
        importlib.import_module("docs_src.generate_clients.tutorial004_py39")

    modified_openapi = json.loads(tmp_file.read_text())
    assert modified_openapi == snapshot(
        {
            "components": {
                "schemas": {
                    "HTTPValidationError": {
                        "properties": {
                            "detail": {
                                "items": {
                                    "$ref": "#/components/schemas/ValidationError",
                                },
                                "title": "Detail",
                                "type": "array",
                            },
                        },
                        "title": "HTTPValidationError",
                        "type": "object",
                    },
                    "Item": {
                        "properties": {
                            "name": {
                                "title": "Name",
                                "type": "string",
                            },
                            "price": {
                                "title": "Price",
                                "type": "number",
                            },
                        },
                        "required": [
                            "name",
                            "price",
                        ],
                        "title": "Item",
                        "type": "object",
                    },
                    "ResponseMessage": {
                        "properties": {
                            "message": {
                                "title": "Message",
                                "type": "string",
                            },
// ... (177 more lines)

Domain

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does test_tutorial004.py do?
test_tutorial004.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_tutorial004.py?
test_tutorial004.py defines 1 function(s): test_remove_tags.
What does test_tutorial004.py depend on?
test_tutorial004.py imports 7 module(s): __init__.py, importlib, inline_snapshot, json, pathlib, tutorial003_py39.py, unittest.mock.
Where is test_tutorial004.py in the architecture?
test_tutorial004.py is located at tests/test_tutorial/test_generate_clients/test_tutorial004.py (domain: FastAPI, subdomain: Applications, directory: tests/test_tutorial/test_generate_clients).

Analyze Your Own Codebase

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

Try Supermodel Free