Home / Function/ test_run_cert_import() — flask Function Reference

test_run_cert_import() — flask Function Reference

Architecture documentation for the test_run_cert_import() function in test_cli.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  b443b3d5_2843_6a81_9972_6cd955cf490d["test_run_cert_import()"]
  62c63da0_a9c3_ab0a_4c48_a9413eac90e3["test_cli.py"]
  b443b3d5_2843_6a81_9972_6cd955cf490d -->|defined in| 62c63da0_a9c3_ab0a_4c48_a9413eac90e3
  style b443b3d5_2843_6a81_9972_6cd955cf490d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_cli.py lines 619–638

def test_run_cert_import(monkeypatch):
    monkeypatch.setitem(sys.modules, "not_here", None)

    # ImportError
    with pytest.raises(click.BadParameter):
        run_command.make_context("run", ["--cert", "not_here"])

    with pytest.raises(click.BadParameter):
        run_command.make_context("run", ["--cert", "flask"])

    # SSLContext
    ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)

    monkeypatch.setitem(sys.modules, "ssl_context", ssl_context)
    ctx = run_command.make_context("run", ["--cert", "ssl_context"])
    assert ctx.params["cert"] is ssl_context

    # no --key with SSLContext
    with pytest.raises(click.BadParameter):
        run_command.make_context("run", ["--cert", "ssl_context", "--key", __file__])

Subdomains

Defined In

Frequently Asked Questions

What does test_run_cert_import() do?
test_run_cert_import() is a function in the flask codebase, defined in tests/test_cli.py.
Where is test_run_cert_import() defined?
test_run_cert_import() is defined in tests/test_cli.py at line 619.

Analyze Your Own Codebase

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

Try Supermodel Free