MCPcopy Create free account
hub / github.com/Vinyzu/Botright / expect_request

Method expect_request

tests/server.py:157–166  ·  view source on GitHub ↗
(self, path: str)

Source from the content-addressed store, hash-verified

155
156 @contextlib.contextmanager
157 def expect_request(self, path: str) -> Generator[ExpectResponse[TestServerRequest], None, None]:
158 future = asyncio.create_task(self.wait_for_request(path))
159
160 cb_wrapper: ExpectResponse[TestServerRequest] = ExpectResponse()
161
162 def done_cb(task: asyncio.Task) -> None:
163 cb_wrapper._value = future.result()
164
165 future.add_done_callback(done_cb)
166 yield cb_wrapper
167
168 def set_auth(self, path: str, username: str, password: str) -> None:
169 self.auth[path] = (username, password)

Calls 2

wait_for_requestMethod · 0.95
ExpectResponseClass · 0.85