Skip to content

Commit

Permalink
Use a different port.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkiro committed Jul 28, 2016
1 parent 26caa6a commit 7721442
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/unit/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ def setUp(self):
self.mock_thread = patch("spoon.server.threading.Thread").start()

def test_shutdown(self):
server = spoon.server.TCPSpoon(("0.0.0.0", 783))
server = spoon.server.TCPSpoon(("0.0.0.0", 30783))
server.shutdown_handler()
self.mock_thread.assert_called_with(target=server.shutdown)

def test_reload(self):
server = spoon.server.TCPSpoon(("0.0.0.0", 783))
server = spoon.server.TCPSpoon(("0.0.0.0", 30783))
server.reload_handler()
self.mock_thread.assert_called_with(target=server.load_config)

def test_server_signals(self):
server = spoon.server.TCPSpoon(("0.0.0.0", 783))
server = spoon.server.TCPSpoon(("0.0.0.0", 30783))
calls = [
call(signal.SIGUSR1, server.reload_handler),
call(signal.SIGTERM, server.shutdown_handler)
Expand Down Expand Up @@ -63,13 +63,13 @@ def tearDown(self):
patch.stopall()

def test_server_forever(self):
server = spoon.server.TCPSpork(("0.0.0.0", 783))
server = spoon.server.TCPSpork(("0.0.0.0", 30783))
server.serve_forever()
self.assertEqual(len(server.pids), 4)

def test_master_shutdown(self):
shutdown = patch("spoon.server.TCPSpoon.shutdown").start()
server = spoon.server.TCPSpork(("0.0.0.0", 783))
server = spoon.server.TCPSpork(("0.0.0.0", 30783))
server.prefork = 2
server.pids = [100, 101]
server.shutdown()
Expand All @@ -81,15 +81,15 @@ def test_master_shutdown(self):

def test_worker_shutdown(self):
shutdown = patch("spoon.server._TCPServer.shutdown").start()
server = spoon.server.TCPSpork(("0.0.0.0", 783))
server = spoon.server.TCPSpork(("0.0.0.0", 30783))

server.prefork = 2
server.pids = None
server.shutdown()
shutdown.assert_called_with()

def test_master_reload(self):
server = spoon.server.TCPSpork(("0.0.0.0", 783))
server = spoon.server.TCPSpork(("0.0.0.0", 30783))

server.prefork = 2
server.pids = [100, 101]
Expand All @@ -102,7 +102,7 @@ def test_master_reload(self):

def test_worker_reload(self):
load_config = patch("spoon.server._SpoonMixIn.load_config").start()
server = spoon.server.TCPSpork(("0.0.0.0", 783))
server = spoon.server.TCPSpork(("0.0.0.0", 30783))

server.prefork = 2
server.pids = None
Expand Down

0 comments on commit 7721442

Please sign in to comment.