From 065ee3422a6ee9d40136cfa6b272e951e15c2e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 1 Mar 2018 17:39:48 +0100 Subject: Add processors --- test.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'test.py') diff --git a/test.py b/test.py index 14b5559..235f618 100644 --- a/test.py +++ b/test.py @@ -2875,9 +2875,9 @@ class HelperTest(WebMockTestCase): self.assertRegex(stdout_mock.getvalue(), "impossible to store report file: FileNotFoundError;") @mock.patch("helper.process_sell_all__1_all_sell") - @mock.patch("helper.process_sell_all__2_all_buy") - @mock.patch("portfolio.Portfolio.wait_for_recent") - def test_main_process_market(self, wait, buy, sell): + @mock.patch("helper.process_sell_all__2_wait") + @mock.patch("helper.process_sell_all__3_all_buy") + def test_main_process_market(self, buy, wait, sell): with self.subTest(before=False, after=False): helper.main_process_market("user", None) @@ -3117,12 +3117,22 @@ class HelperTest(WebMockTestCase): mock.call("process_sell_all__1_all_sell_end") ]) - def test_process_sell_all__2_all_buy(self): - helper.process_sell_all__2_all_buy(self.m) + @mock.patch("portfolio.Portfolio.wait_for_recent") + def test_process_sell_all__2_wait(self, wait): + helper.process_sell_all__2_wait(self.m) + + wait.assert_called_once_with(self.m) + self.m.report.log_stage.assert_has_calls([ + mock.call("process_sell_all__2_wait_begin"), + mock.call("process_sell_all__2_wait_end") + ]) + + def test_process_sell_all__3_all_buy(self): + helper.process_sell_all__3_all_buy(self.m) self.m.balances.fetch_balances.assert_has_calls([ - mock.call(tag="process_sell_all__2_all_buy_begin"), - mock.call(tag="process_sell_all__2_all_buy_end"), + mock.call(tag="process_sell_all__3_all_buy_begin"), + mock.call(tag="process_sell_all__3_all_buy_end"), ]) self.m.prepare_trades.assert_called_with(base_currency="BTC", liquidity="medium") @@ -3131,8 +3141,8 @@ class HelperTest(WebMockTestCase): self.m.trades.run_orders.assert_called() self.m.follow_orders.assert_called() self.m.report.log_stage.assert_has_calls([ - mock.call("process_sell_all__2_all_buy_begin"), - mock.call("process_sell_all__2_all_buy_end") + mock.call("process_sell_all__3_all_buy_begin"), + mock.call("process_sell_all__3_all_buy_end") ]) @unittest.skipUnless("acceptance" in limits, "Acceptance skipped") -- cgit v1.2.3