From 819025384506c75bce1fbfb42c1b0ba9aa5da7c0 Mon Sep 17 00:00:00 2001 From: Wayne Date: Thu, 11 Jul 2019 23:43:52 +0200 Subject: [PATCH] Revert "server and client initial commit" This reverts commit b9d5a799f409753722dba98949df6ff24af6a54c. --- conftest.py | 14 ++------------ test/test_Server.py | 8 ++++++++ 2 files changed, 10 insertions(+), 12 deletions(-) create mode 100644 test/test_Server.py diff --git a/conftest.py b/conftest.py index 343ff95..086ca95 100644 --- a/conftest.py +++ b/conftest.py @@ -1,23 +1,13 @@ """ setup the fixtures for our test """ -import socketserver - import pytest @pytest.fixture() def server(): """ - starts the server + returns a fresh server instance """ from src.server import Handler_TCPServer - - HOST, PORT = "localhost", 9999 - - # Init the TCP server object, bind it to the localhost on 9999 port - tcp_server = socketserver.TCPServer((HOST, PORT), Handler_TCPServer) - - # Activate the TCP server. - # To abort the TCP server, press Ctrl-C. - tcp_server.serve_forever() + return Handler_TCPServer diff --git a/test/test_Server.py b/test/test_Server.py new file mode 100644 index 0000000..71577cf --- /dev/null +++ b/test/test_Server.py @@ -0,0 +1,8 @@ +""" + tests the server functionality +""" + + +def test_ping(server): + server.ping(server, "some message") + assert server.ping(server, "some message") == "PONG"