MCPcopy Create free account
hub / github.com/commandoperator/cmdop-sdk / _CaptureWriter

Class _CaptureWriter

python/tests/test_transport.py:40–54  ·  view source on GitHub ↗

A StreamWriter-like sink: bytes land on an asyncio.StreamReader the test 'core' reads, so the core sees exactly what the transport wrote.

Source from the content-addressed store, hash-verified

38 self.stderr.feed_eof()
39 self.requests = asyncio.StreamReader()
40 self.stdin = _Writer(self.requests)
41
42 async def wait(self) -> int:
43 return 0
44
45 def kill(self) -> None:
46 pass
47
48
49def _transport() -> tuple[Transport, _Process]:
50 transport = Transport(ClientConfig(token="t", base_url="https://relay", timeout_ms=1000), "/none")
51 process = _Process()
52 transport._process = process # type: ignore[assignment]
53 transport._reader_task = asyncio.create_task(transport._read_loop())
54 return transport, process
55
56
57def _feed(process: _Process, envelope: pb.Envelope) -> None:

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by 1

__init__Method · 0.56