Home / File/ test_js_example.py — flask Source File

test_js_example.py — flask Source File

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

Entity Profile

Dependency Diagram

graph LR
  eecd6aa7_f32c_3624_d8f3_7bdd1e740c48["test_js_example.py"]
  da94d511_b8b8_a450_f67f_fc28ea9b648a["pytest"]
  eecd6aa7_f32c_3624_d8f3_7bdd1e740c48 --> da94d511_b8b8_a450_f67f_fc28ea9b648a
  8c762fc5_c0b6_0d4d_3889_896d80fbf225["flask"]
  eecd6aa7_f32c_3624_d8f3_7bdd1e740c48 --> 8c762fc5_c0b6_0d4d_3889_896d80fbf225
  style eecd6aa7_f32c_3624_d8f3_7bdd1e740c48 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import pytest
from flask import template_rendered


@pytest.mark.parametrize(
    ("path", "template_name"),
    (
        ("/", "fetch.html"),
        ("/plain", "xhr.html"),
        ("/fetch", "fetch.html"),
        ("/jquery", "jquery.html"),
    ),
)
def test_index(app, client, path, template_name):
    def check(sender, template, context):
        assert template.name == template_name

    with template_rendered.connected_to(check, app):
        client.get(path)


@pytest.mark.parametrize(
    ("a", "b", "result"), ((2, 3, 5), (2.5, 3, 5.5), (2, None, 2), (2, "b", 2))
)
def test_add(client, a, b, result):
    response = client.post("/add", data={"a": a, "b": b})
    assert response.get_json()["result"] == result

Subdomains

Dependencies

  • flask
  • pytest

Frequently Asked Questions

What does test_js_example.py do?
test_js_example.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_js_example.py?
test_js_example.py defines 2 function(s): test_add, test_index.
What does test_js_example.py depend on?
test_js_example.py imports 2 module(s): flask, pytest.
Where is test_js_example.py in the architecture?
test_js_example.py is located at examples/javascript/tests/test_js_example.py (domain: ApplicationCore, subdomain: ExtensionRegistry, directory: examples/javascript/tests).

Analyze Your Own Codebase

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

Try Supermodel Free