Use the CLI to run the app
This commit is contained in:
parent
c722c12ba4
commit
cd8cae18c5
1 changed files with 2 additions and 7 deletions
|
@ -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()
|
||||
|
|
Reference in a new issue