Skip to content

Commit

Permalink
add writer.drain() after writer.write() (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
allrob23 authored Oct 22, 2024
1 parent 3aec239 commit ee7c34f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/mock_pchk.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ async def authentication(self) -> bool:

if self.license_error:
self.writer.write(b"$err:(license?)" + self.separator)
await self.writer.drain()
return False

return True
Expand Down Expand Up @@ -158,6 +159,7 @@ async def send_message(self, message: str) -> None:
"""Send the given message to the socket."""
assert self.writer is not None
self.writer.write(message.encode() + self.separator)
await self.writer.drain()

async def received(
self, message: bytes | str, timeout: int = 5, remove: bool = True
Expand Down

0 comments on commit ee7c34f

Please sign in to comment.