connect() uses the port from the URI or the default port.
(self)
| 128 | self.assertEqual(request.path, "/endpoint?test=1") |
| 129 | |
| 130 | def test_port(self): |
| 131 | """connect() uses the port from the URI or the default port.""" |
| 132 | for uri, host in [ |
| 133 | ("ws://example.com/", "example.com"), |
| 134 | ("ws://example.com:80/", "example.com"), |
| 135 | ("ws://example.com:8080/", "example.com:8080"), |
| 136 | ("wss://example.com/", "example.com"), |
| 137 | ("wss://example.com:443/", "example.com"), |
| 138 | ("wss://example.com:8443/", "example.com:8443"), |
| 139 | ]: |
| 140 | with self.subTest(uri=uri): |
| 141 | client = ClientProtocol(parse_uri(uri)) |
| 142 | request = client.connect() |
| 143 | |
| 144 | self.assertEqual(request.headers["Host"], host) |
| 145 | |
| 146 | def test_user_info(self): |
| 147 | """connect() perfoms HTTP Basic Authentication with user info from the URI.""" |
nothing calls this directly
no test coverage detected