Use the CLI to run the app

This commit is contained in:
Jake Howard 2018-12-13 17:10:14 +00:00
parent c722c12ba4
commit cd8cae18c5
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -1,6 +1,5 @@
import functools
import os
from multiprocessing import Process
from aiohttp.test_utils import unused_port
from aiounittest import AsyncTestCase
@ -32,12 +31,8 @@ class BaseWorkerTestCase(BaseTestCase):
def setUp(self):
super().setUp()
self.unused_port = unused_port()
self.router_process = Process(
target=worker.run, args=(self.unused_port,), daemon=True
)
self.router_process.start()
worker.wait_for_running_worker()
self.assertEqual(self.run_cli(["start"]).exit_code, 0)
def tearDown(self):
self.router_process.terminate()
self.assertEqual(self.run_cli(["stop"]).exit_code, 0)
super().tearDown()