MCPcopy Index your code
hub / github.com/python-websockets/websockets / test_user_info

Method test_user_info

tests/test_client.py:146–151  ·  view source on GitHub ↗

connect() perfoms HTTP Basic Authentication with user info from the URI.

(self)

Source from the content-addressed store, hash-verified

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."""
148 client = ClientProtocol(parse_uri("wss://hello:iloveyou@example.com/"))
149 request = client.connect()
150
151 self.assertEqual(request.headers["Authorization"], "Basic aGVsbG86aWxvdmV5b3U=")
152
153 def test_origin(self):
154 """connect(origin=...) generates an Origin header."""

Callers

nothing calls this directly

Calls 3

connectMethod · 0.95
parse_uriFunction · 0.90
ClientProtocolClass · 0.85

Tested by

no test coverage detected