Simplify testing connection w/ other simplifications
This commit is contained in:
parent
10e30beb42
commit
737195f461
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user