This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
catfish/tests/test_worker/test_server.py
Jake Howard ce29af5459
Use custom program rather than yes
Yes may be too IO intensive, and may not exist on all systems
2018-12-13 14:06:47 +00:00

18 lines
670 B
Python

from catfish.utils.processes import is_process_running
from catfish.worker.server import send_to_server
from tests import BaseWorkerTestCase
class WorkerServerTestCase(BaseWorkerTestCase):
def test_server_creates_process(self):
response = send_to_server({"type": "process", "command": self.DUMMY_EXE})
self.assertTrue(is_process_running(response["pid"]))
def test_unknown_command_type(self):
response = send_to_server({"type": "nothing"})
self.assertEqual(response, {"error": "Invalid command"})
def test_ping(self):
response = send_to_server({"type": "ping"})
self.assertEqual(response, {"ping": "pong"})