Home / Function/ test_different_connection_pool_for_mtls_settings() — requests Function Reference

test_different_connection_pool_for_mtls_settings() — requests Function Reference

Architecture documentation for the test_different_connection_pool_for_mtls_settings() function in test_requests.py from the requests codebase.

Entity Profile

Dependency Diagram

graph TD
  ea4fb33f_003a_ddd6_e164_5262d5dae550["test_different_connection_pool_for_mtls_settings()"]
  0e391504_f528_a095_5b1a_95d479a82586["TestPreparingURLs"]
  ea4fb33f_003a_ddd6_e164_5262d5dae550 -->|defined in| 0e391504_f528_a095_5b1a_95d479a82586
  772251a3_91b5_d6a8_857f_bb938ed045f7["send()"]
  ea4fb33f_003a_ddd6_e164_5262d5dae550 -->|calls| 772251a3_91b5_d6a8_857f_bb938ed045f7
  style ea4fb33f_003a_ddd6_e164_5262d5dae550 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_requests.py lines 2969–3006

    def test_different_connection_pool_for_mtls_settings(self):
        client_cert = None

        def response_handler(sock):
            nonlocal client_cert
            client_cert = sock.getpeercert()
            consume_socket_content(sock, timeout=0.5)
            sock.send(
                b"HTTP/1.1 200 OK\r\n"
                b"Content-Length: 18\r\n\r\n"
                b'\xff\xfe{\x00"\x00K0"\x00=\x00"\x00\xab0"\x00\r\n'
            )

        s = requests.Session()
        close_server = threading.Event()
        server = TLSServer(
            handler=response_handler,
            wait_to_close_event=close_server,
            requests_to_handle=2,
            cert_chain="tests/certs/expired/server/server.pem",
            keyfile="tests/certs/expired/server/server.key",
            mutual_tls=True,
            cacert="tests/certs/expired/ca/ca.crt",
        )

        cert = (
            "tests/certs/mtls/client/client.pem",
            "tests/certs/mtls/client/client.key",
        )
        with server as (host, port):
            url = f"https://{host}:{port}"
            r1 = s.get(url, verify=False, cert=cert)
            assert r1.status_code == 200
            with pytest.raises(requests.exceptions.SSLError):
                s.get(url, cert=cert)
            close_server.set()

        assert client_cert is not None

Domain

Subdomains

Calls

Frequently Asked Questions

What does test_different_connection_pool_for_mtls_settings() do?
test_different_connection_pool_for_mtls_settings() is a function in the requests codebase, defined in tests/test_requests.py.
Where is test_different_connection_pool_for_mtls_settings() defined?
test_different_connection_pool_for_mtls_settings() is defined in tests/test_requests.py at line 2969.
What does test_different_connection_pool_for_mtls_settings() call?
test_different_connection_pool_for_mtls_settings() calls 1 function(s): send.

Analyze Your Own Codebase

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

Try Supermodel Free