Home / Function/ test_handle_generic_http() — flask Function Reference

test_handle_generic_http() — flask Function Reference

Architecture documentation for the test_handle_generic_http() function in test_user_error_handler.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  4146f47c_bb85_f8c0_436a_b7db8b76fad3["test_handle_generic_http()"]
  d43f613b_526f_83b2_b03e_180d5f56de23["TestGenericHandlers"]
  4146f47c_bb85_f8c0_436a_b7db8b76fad3 -->|defined in| d43f613b_526f_83b2_b03e_180d5f56de23
  style 4146f47c_bb85_f8c0_436a_b7db8b76fad3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_user_error_handler.py lines 269–281

    def test_handle_generic_http(self, app, client):
        """``HTTPException`` should only receive ``HTTPException``
        subclasses. It will receive ``404`` routing exceptions.
        """

        @app.errorhandler(HTTPException)
        def handle_http(e):
            assert isinstance(e, HTTPException)
            return str(e.code)

        assert client.get("/error").data == b"500"
        assert client.get("/abort").data == b"500"
        assert client.get("/not-found").data == b"404"

Subdomains

Frequently Asked Questions

What does test_handle_generic_http() do?
test_handle_generic_http() is a function in the flask codebase, defined in tests/test_user_error_handler.py.
Where is test_handle_generic_http() defined?
test_handle_generic_http() is defined in tests/test_user_error_handler.py at line 269.

Analyze Your Own Codebase

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

Try Supermodel Free