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 functools
|
||||||
import os
|
import os
|
||||||
from multiprocessing import Process
|
|
||||||
|
|
||||||
from aiohttp.test_utils import unused_port
|
from aiohttp.test_utils import unused_port
|
||||||
from aiounittest import AsyncTestCase
|
from aiounittest import AsyncTestCase
|
||||||
|
@ -32,12 +31,8 @@ class BaseWorkerTestCase(BaseTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
self.unused_port = unused_port()
|
self.unused_port = unused_port()
|
||||||
self.router_process = Process(
|
self.assertEqual(self.run_cli(["start"]).exit_code, 0)
|
||||||
target=worker.run, args=(self.unused_port,), daemon=True
|
|
||||||
)
|
|
||||||
self.router_process.start()
|
|
||||||
worker.wait_for_running_worker()
|
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.router_process.terminate()
|
self.assertEqual(self.run_cli(["stop"]).exit_code, 0)
|
||||||
super().tearDown()
|
super().tearDown()
|
||||||
|
|
Reference in a new issue