Home / File/ test_session_interface.py — flask Source File

test_session_interface.py — flask Source File

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

File python ApplicationCore ExtensionRegistry 3 imports 1 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  ddf20531_87e2_6e31_f458_6d380fe08765["test_session_interface.py"]
  8c762fc5_c0b6_0d4d_3889_896d80fbf225["flask"]
  ddf20531_87e2_6e31_f458_6d380fe08765 --> 8c762fc5_c0b6_0d4d_3889_896d80fbf225
  3e36f42e_6b7c_ad20_fe7e_3ce2e69941e4["flask.globals"]
  ddf20531_87e2_6e31_f458_6d380fe08765 --> 3e36f42e_6b7c_ad20_fe7e_3ce2e69941e4
  31623311_8417_0e4f_f6ff_2a7374d9355b["flask.sessions"]
  ddf20531_87e2_6e31_f458_6d380fe08765 --> 31623311_8417_0e4f_f6ff_2a7374d9355b
  style ddf20531_87e2_6e31_f458_6d380fe08765 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import flask
from flask.globals import app_ctx
from flask.sessions import SessionInterface


def test_open_session_with_endpoint():
    """If request.endpoint (or other URL matching behavior) is needed
    while loading the session, RequestContext.match_request() can be
    called manually.
    """

    class MySessionInterface(SessionInterface):
        def save_session(self, app, session, response):
            pass

        def open_session(self, app, request):
            app_ctx.match_request()
            assert request.endpoint is not None

    app = flask.Flask(__name__)
    app.session_interface = MySessionInterface()

    @app.get("/")
    def index():
        return "Hello, World!"

    response = app.test_client().get("/")
    assert response.status_code == 200

Subdomains

Dependencies

  • flask
  • flask.globals
  • flask.sessions

Frequently Asked Questions

What does test_session_interface.py do?
test_session_interface.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_session_interface.py?
test_session_interface.py defines 1 function(s): test_open_session_with_endpoint.
What does test_session_interface.py depend on?
test_session_interface.py imports 3 module(s): flask, flask.globals, flask.sessions.
Where is test_session_interface.py in the architecture?
test_session_interface.py is located at tests/test_session_interface.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