diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-04-07 17:39:29 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-04-07 19:43:48 +0200 |
commit | e7d7c0e5645da35adcbfec9e51deb68f012c422f (patch) | |
tree | 990a884e058cff0467f7486efb422fb6b659f709 /tests/test_main.py | |
parent | c682bdf4a02a45312ef1aadf8aa26136cf308414 (diff) | |
download | Trader-e7d7c0e5645da35adcbfec9e51deb68f012c422f.tar.gz Trader-e7d7c0e5645da35adcbfec9e51deb68f012c422f.tar.zst Trader-e7d7c0e5645da35adcbfec9e51deb68f012c422f.zip |
Acceptance test preparation
Save some headers for http requests
Wait for all threads after the end of main
Simplify library imports for mocking
Diffstat (limited to 'tests/test_main.py')
-rw-r--r-- | tests/test_main.py | 4 |
1 files changed, 3 insertions, 1 deletions
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): | |||
179 | mock.patch("main.parse_config") as parse_config,\ | 179 | mock.patch("main.parse_config") as parse_config,\ |
180 | mock.patch("main.fetch_markets") as fetch_markets,\ | 180 | mock.patch("main.fetch_markets") as fetch_markets,\ |
181 | mock.patch("main.process") as process,\ | 181 | mock.patch("main.process") as process,\ |
182 | mock.patch("store.Portfolio.start_worker") as start: | 182 | mock.patch("store.Portfolio.start_worker") as start,\ |
183 | mock.patch("store.Portfolio.stop_worker") as stop: | ||
183 | 184 | ||
184 | args_mock = mock.Mock() | 185 | args_mock = mock.Mock() |
185 | args_mock.parallel = True | 186 | args_mock.parallel = True |
@@ -196,6 +197,7 @@ class MainTest(WebMockTestCase): | |||
196 | parse_config.assert_called_with(args_mock) | 197 | parse_config.assert_called_with(args_mock) |
197 | fetch_markets.assert_called_with("pg_config", "user") | 198 | fetch_markets.assert_called_with("pg_config", "user") |
198 | 199 | ||
200 | stop.assert_called_once_with() | ||
199 | start.assert_called_once_with() | 201 | start.assert_called_once_with() |
200 | self.assertEqual(2, process.call_count) | 202 | self.assertEqual(2, process.call_count) |
201 | process.assert_has_calls([ | 203 | process.assert_has_calls([ |