Home / File/ test_basic.py — flask Source File

test_basic.py — flask Source File

Architecture documentation for test_basic.py, a python file in the flask codebase. 19 imports, 0 dependents.

File python ApplicationCore ExtensionRegistry 19 imports 88 functions 7 classes

Entity Profile

Dependency Diagram

graph LR
  85bc4fb5_d1d7_a135_020d_69e052c12c0f["test_basic.py"]
  4ebb523a_99d8_b7f3_9638_88f6fa40b3bd["gc"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> 4ebb523a_99d8_b7f3_9638_88f6fa40b3bd
  7d9ebc53_a992_d150_c79b_39c114a84acf["importlib.metadata"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> 7d9ebc53_a992_d150_c79b_39c114a84acf
  2d179a80_c967_3979_8233_1db27e63ff0d["re"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> 2d179a80_c967_3979_8233_1db27e63ff0d
  852dc50b_4da6_57dc_ead7_cdd90925e0b8["typing"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> 852dc50b_4da6_57dc_ead7_cdd90925e0b8
  c26d67c5_e5bf_05b7_bcb4_ac69089e1109["uuid"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> c26d67c5_e5bf_05b7_bcb4_ac69089e1109
  63a99ca9_769e_3a2f_1040_efa398b8241d["weakref"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> 63a99ca9_769e_3a2f_1040_efa398b8241d
  edaa6006_b261_47ac_daeb_d732207d6228["contextlib"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> edaa6006_b261_47ac_daeb_d732207d6228
  bdb4799f_8b0c_fcfd_51cc_f0b833652f8f["datetime"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> bdb4799f_8b0c_fcfd_51cc_f0b833652f8f
  7aa2bb55_1207_c6a6_eaea_dc8955c0e441["platform"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> 7aa2bb55_1207_c6a6_eaea_dc8955c0e441
  da94d511_b8b8_a450_f67f_fc28ea9b648a["pytest"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> da94d511_b8b8_a450_f67f_fc28ea9b648a
  ff917c05_6a39_6aa2_fc98_d3c5af4516f4["werkzeug.serving"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> ff917c05_6a39_6aa2_fc98_d3c5af4516f4
  73ef7241_8c5f_09fd_18d9_bc9f2aafacb1["markupsafe"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> 73ef7241_8c5f_09fd_18d9_bc9f2aafacb1
  9b468bc7_cc0b_fef2_ed71_07b4f027fb55["werkzeug.exceptions"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> 9b468bc7_cc0b_fef2_ed71_07b4f027fb55
  c8ef0481_732f_584a_537b_20ea831e8fd0["werkzeug.http"]
  85bc4fb5_d1d7_a135_020d_69e052c12c0f --> c8ef0481_732f_584a_537b_20ea831e8fd0
  style 85bc4fb5_d1d7_a135_020d_69e052c12c0f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import gc
import importlib.metadata
import re
import typing as t
import uuid
import weakref
from contextlib import nullcontext
from datetime import datetime
from datetime import timezone
from platform import python_implementation

import pytest
import werkzeug.serving
from markupsafe import Markup
from werkzeug.exceptions import BadRequest
from werkzeug.exceptions import Forbidden
from werkzeug.exceptions import NotFound
from werkzeug.http import parse_date
from werkzeug.routing import BuildError
from werkzeug.routing import RequestRedirect

import flask

require_cpython_gc = pytest.mark.skipif(
    python_implementation() != "CPython",
    reason="Requires CPython GC behavior",
)


def test_options_work(app, client):
    @app.route("/", methods=["GET", "POST"])
    def index():
        return "Hello World"

    rv = client.open("/", method="OPTIONS")
    assert sorted(rv.allow) == ["GET", "HEAD", "OPTIONS", "POST"]
    assert rv.data == b""


def test_options_on_multiple_rules(app, client):
    @app.route("/", methods=["GET", "POST"])
    def index():
        return "Hello World"

    @app.route("/", methods=["PUT"])
    def index_put():
        return "Aha!"

    rv = client.open("/", method="OPTIONS")
    assert sorted(rv.allow) == ["GET", "HEAD", "OPTIONS", "POST", "PUT"]


@pytest.mark.parametrize("method", ["get", "post", "put", "delete", "patch"])
def test_method_route(app, client, method):
    method_route = getattr(app, method)
    client_method = getattr(client, method)

    @method_route("/")
    def hello():
        return "Hello"
// ... (1890 more lines)

Subdomains

Functions

Dependencies

  • contextlib
  • dataclasses
  • datetime
  • flask
  • flask.debughelpers
  • gc
  • importlib.metadata
  • markupsafe
  • pathlib
  • platform
  • pytest
  • re
  • typing
  • uuid
  • weakref
  • werkzeug.exceptions
  • werkzeug.http
  • werkzeug.routing
  • werkzeug.serving

Frequently Asked Questions

What does test_basic.py do?
test_basic.py is a source file in the flask codebase, written in python. It belongs to the ApplicationCore domain, ExtensionRegistry subdomain.
What functions are defined in test_basic.py?
test_basic.py defines 88 function(s): test_after_request_processing, test_app_freed_on_zero_refcount, test_baseexception_error_handling, test_before_after_request_order, test_before_request_and_routing_errors, test_build_error_handler, test_build_error_handler_reraise, test_disallow_string_for_allowed_methods, test_enctype_debug_helper, test_endpoint_decorator, and 78 more.
What does test_basic.py depend on?
test_basic.py imports 19 module(s): contextlib, dataclasses, datetime, flask, flask.debughelpers, gc, importlib.metadata, markupsafe, and 11 more.
Where is test_basic.py in the architecture?
test_basic.py is located at tests/test_basic.py (domain: ApplicationCore, subdomain: ExtensionRegistry, directory: tests).

Analyze Your Own Codebase

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

Try Supermodel Free