From 2569eac3a071761c078799db40bce725fe3e4832 Mon Sep 17 00:00:00 2001 From: zixuanzh Date: Tue, 20 Nov 2018 23:49:37 -0500 Subject: [PATCH] lint --- network/connection/raw_connection.py | 1 - tests/network/test_connection.py | 14 ++++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/network/connection/raw_connection.py b/network/connection/raw_connection.py index 6612854..1569f22 100644 --- a/network/connection/raw_connection.py +++ b/network/connection/raw_connection.py @@ -9,6 +9,5 @@ class RawConnection(IRawConnection): self.reader = reader self.writer = writer - def close(self): self.writer.close() diff --git a/tests/network/test_connection.py b/tests/network/test_connection.py index 64c1a91..56f4cc2 100644 --- a/tests/network/test_connection.py +++ b/tests/network/test_connection.py @@ -1,29 +1,27 @@ -import pytest import asyncio +import pytest -from network.connection.raw_connection import RawConnection +# from network.connection.raw_connection import RawConnection async def handle_echo(reader, writer): data = await reader.read(100) - message = data.decode() - writer.write(data) await writer.drain() writer.close() @pytest.mark.asyncio -async def test_echo(): +async def test_simple_echo(): server_ip = '127.0.0.1' server_port = 8888 await asyncio.start_server(handle_echo, server_ip, server_port) reader, writer = await asyncio.open_connection(server_ip, server_port) - raw_connection = RawConnection(server_ip, server_port, reader, writer) - + # raw_connection = RawConnection(server_ip, server_port, reader, writer) + test_message = "hello world" writer.write(test_message.encode()) response = (await reader.read()).decode() - + assert response == (test_message)