| 232 | |
| 233 | @contextlib.contextmanager |
| 234 | def expect_websocket( |
| 235 | self, |
| 236 | ) -> Generator[ExpectResponse["WebSocketProtocol"], None, None]: |
| 237 | future = self.wait_for_web_socket() |
| 238 | |
| 239 | cb_wrapper: ExpectResponse["WebSocketProtocol"] = ExpectResponse() |
| 240 | |
| 241 | def done_cb(_: asyncio.Future) -> None: |
| 242 | cb_wrapper._value = future.result() |
| 243 | |
| 244 | future.add_done_callback(done_cb) |
| 245 | yield cb_wrapper |
| 246 | |
| 247 | def set_auth(self, path: str, username: str, password: str) -> None: |
| 248 | self.auth[path] = (username, password) |