Simplify testing connection w/ other simplifications

This commit is contained in:
Alex Stokes 2019-08-24 23:15:31 +02:00
parent 10e30beb42
commit 737195f461
No known key found for this signature in database
GPG Key ID: 51CE1721B245C086

View File

@ -19,15 +19,6 @@ class InMemoryConnection(IRawConnection):
self.current_position = 0
self.closed = False
self.stream_counter = 0
@property
def writer(self):
return self
@property
def reader(self):
return self
async def write(self, data: bytes) -> None:
if self.closed:
@ -35,12 +26,6 @@ class InMemoryConnection(IRawConnection):
await self.send_queue.put(data)
async def drain(self):
return
async def readexactly(self, n):
return await self.read(n)
async def read(self, n: int = -1) -> bytes:
"""
NOTE: have to buffer the current message and juggle packets
@ -67,10 +52,6 @@ class InMemoryConnection(IRawConnection):
def close(self) -> None:
self.closed = True
def next_stream_id(self) -> int:
self.stream_counter += 1
return self.stream_counter
async def create_pipe(local_conn, remote_conn):
try: