diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-05-07 12:50:43 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-05-07 12:51:05 +0200 |
commit | af928d32483535a817b62a68f2dcb215f48ed29c (patch) | |
tree | 3f568540a2c16adb2cce3121e22ac7eb413c1986 /tests | |
parent | 4ae84fb7861938f7d98802a5621b1bbd6745c914 (diff) | |
download | Trader-af928d32483535a817b62a68f2dcb215f48ed29c.tar.gz Trader-af928d32483535a817b62a68f2dcb215f48ed29c.tar.zst Trader-af928d32483535a817b62a68f2dcb215f48ed29c.zip |
Run prepared orders after disappeared order
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_market.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_market.py b/tests/test_market.py index 0211638..6a9ea76 100644 --- a/tests/test_market.py +++ b/tests/test_market.py | |||
@@ -381,12 +381,16 @@ class MarketTest(WebMockTestCase): | |||
381 | order_mock2.trade = trade_mock | 381 | order_mock2.trade = trade_mock |
382 | 382 | ||
383 | trade_mock.tick_actions_recreate.return_value = "tick1" | 383 | trade_mock.tick_actions_recreate.return_value = "tick1" |
384 | new_order_mock = mock.Mock() | ||
385 | trade_mock.prepare_order.return_value = new_order_mock | ||
384 | 386 | ||
385 | m.follow_orders() | 387 | m.follow_orders() |
386 | 388 | ||
387 | trade_mock.tick_actions_recreate.assert_called_once_with(2) | 389 | trade_mock.tick_actions_recreate.assert_called_once_with(2) |
388 | trade_mock.prepare_order.assert_called_once_with(compute_value="tick1") | 390 | trade_mock.prepare_order.assert_called_once_with(compute_value="tick1") |
389 | m.report.log_error.assert_called_once_with("follow_orders", message=mock.ANY) | 391 | m.report.log_error.assert_called_once_with("follow_orders", message=mock.ANY) |
392 | m.report.log_order.assert_called_with(order_mock2, 2, new_order=new_order_mock) | ||
393 | new_order_mock.run.assert_called_once_with() | ||
390 | 394 | ||
391 | @mock.patch.object(market.BalanceStore, "fetch_balances") | 395 | @mock.patch.object(market.BalanceStore, "fetch_balances") |
392 | def test_move_balance(self, fetch_balances): | 396 | def test_move_balance(self, fetch_balances): |