miracle2k / trio-protocol

Run asyncio protocols on top of trio
7 stars 1 forks source link

Some way to test protocols leveraging `trio.testing` #2

Open asmodehn opened 5 years ago

asmodehn commented 5 years ago

Trio provides facilities for testing via trio.testing

It seems these would come in useful here, as a way to extensively test a user's custom protocols, in an efficient way, without doing any actual system call.

For example, one could want to test a protocol over a memory_stream_pair transport (my current use-case)

As for what the API could look like, I don't have a clear picture just yet. The intention is simply to provide a similar abstraction of a 'listener'/'server' "running", while a 'client' attempts to connect to it. The client and the server will likely just be 2 coroutines communicating over a memory transport...