From 34f3c290d3e544f2947afacf2a7364f758486028 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 20 Apr 2019 02:19:03 +0200 Subject: [PATCH] Delete useless tests --- tests/test_network.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 tests/test_network.py diff --git a/tests/test_network.py b/tests/test_network.py deleted file mode 100644 index 9143e932..00000000 --- a/tests/test_network.py +++ /dev/null @@ -1,41 +0,0 @@ -import pytest -import logging -import asyncio -from royalnet.network import RoyalnetLink, RoyalnetServer -from royalnet.network import Message - - -log = logging.getLogger("royalnet.network.royalnetserver") -log.setLevel(logging.DEBUG) -log.addHandler(logging.StreamHandler()) - - -async def echo(message: Message): - return message - - -# This test broke, but I don't know why. -# def test_connection(): -# loop = asyncio.SelectorEventLoop() -# server = RoyalnetServer("localhost", 1234, "testing") -# link = RoyalnetLink("ws://localhost:1234", "testing", "testing", echo) -# loop.create_task(server.run()) -# loop.create_task(link.run()) -# loop.run_until_complete(asyncio.sleep(10)) -# assert link.websocket is not None -# assert link.identify_event.is_set() -# assert len(server.identified_clients) == 1 -# assert server.identified_clients[0].link_type == "testing" - - -def test_request(): - loop = asyncio.SelectorEventLoop() - server = RoyalnetServer("localhost", 1234, "testing") - link1 = RoyalnetLink("ws://localhost:1234", "testing", "testing1", echo) - link2 = RoyalnetLink("ws://localhost:1234", "testing", "testing2", echo) - loop.create_task(server.run()) - loop.create_task(link1.run()) - loop.create_task(link2.run()) - message = Message() - response = loop.run_until_complete(link1.request(message, "testing2")) - assert message is response