MCPcopy
hub / github.com/urllib3/urllib3 / test_e2e_connect_to_ipv6_scoped

Method test_e2e_connect_to_ipv6_scoped

test/test_poolmanager.py:443–457  ·  view source on GitHub ↗

Checks that IPv6 scoped addresses are properly handled end-to-end. This is not strictly speaking a pool manager unit test - this test lives here in absence of a better code location for e2e/integration tests.

(
        self, create_connection: MagicMock, url: str
    )

Source from the content-addressed store, hash-verified

441 )
442 @patch("urllib3.util.connection.create_connection")
443 def test_e2e_connect_to_ipv6_scoped(
444 self, create_connection: MagicMock, url: str
445 ) -> None:
446 """Checks that IPv6 scoped addresses are properly handled end-to-end.
447
448 This is not strictly speaking a pool manager unit test - this test
449 lives here in absence of a better code location for e2e/integration
450 tests.
451 """
452 p = PoolManager()
453 conn_pool = p.connection_from_url(url)
454 conn = conn_pool._get_conn()
455 conn.connect()
456
457 assert create_connection.call_args[0][0] == ("a::b%zone", 80)
458
459 @patch("urllib3.connection.ssl_wrap_socket")
460 @patch("urllib3.util.connection.create_connection")

Callers

nothing calls this directly

Calls 4

connection_from_urlMethod · 0.95
PoolManagerClass · 0.90
_get_connMethod · 0.80
connectMethod · 0.45

Tested by

no test coverage detected