From e7d7c0e5645da35adcbfec9e51deb68f012c422f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 7 Apr 2018 17:39:29 +0200 Subject: Acceptance test preparation Save some headers for http requests Wait for all threads after the end of main Simplify library imports for mocking --- tests/test_main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/test_main.py') diff --git a/tests/test_main.py b/tests/test_main.py index 6396c07..e3a5677 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -179,7 +179,8 @@ class MainTest(WebMockTestCase): mock.patch("main.parse_config") as parse_config,\ mock.patch("main.fetch_markets") as fetch_markets,\ mock.patch("main.process") as process,\ - mock.patch("store.Portfolio.start_worker") as start: + mock.patch("store.Portfolio.start_worker") as start,\ + mock.patch("store.Portfolio.stop_worker") as stop: args_mock = mock.Mock() args_mock.parallel = True @@ -196,6 +197,7 @@ class MainTest(WebMockTestCase): parse_config.assert_called_with(args_mock) fetch_markets.assert_called_with("pg_config", "user") + stop.assert_called_once_with() start.assert_called_once_with() self.assertEqual(2, process.call_count) process.assert_has_calls([ -- cgit v1.2.3