aboutsummaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-03-01 15:23:27 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-03-01 15:23:27 +0100
commit23f4616a85bef7e9acc57740f889a2a0346788af (patch)
treed701f03a699c107e16a562a106bf67a1071a7e2f /test.py
parent7192b2e1315c3dfd1204d609d716dd07e90f3bf4 (diff)
downloadTrader-23f4616a85bef7e9acc57740f889a2a0346788af.tar.gz
Trader-23f4616a85bef7e9acc57740f889a2a0346788af.tar.zst
Trader-23f4616a85bef7e9acc57740f889a2a0346788af.zip
Dynamically use process methods
Diffstat (limited to 'test.py')
-rw-r--r--test.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/test.py b/test.py
index fbc857d..14b5559 100644
--- a/test.py
+++ b/test.py
@@ -2920,7 +2920,7 @@ class HelperTest(WebMockTestCase):
2920 sell.reset_mock() 2920 sell.reset_mock()
2921 with self.subTest(action="print_balances"),\ 2921 with self.subTest(action="print_balances"),\
2922 mock.patch("helper.print_balances") as print_balances: 2922 mock.patch("helper.print_balances") as print_balances:
2923 helper.main_process_market("user", "print_balances") 2923 helper.main_process_market("user", ["print_balances"])
2924 2924
2925 buy.assert_not_called() 2925 buy.assert_not_called()
2926 wait.assert_not_called() 2926 wait.assert_not_called()
@@ -2928,17 +2928,19 @@ class HelperTest(WebMockTestCase):
2928 print_balances.assert_called_once_with("user") 2928 print_balances.assert_called_once_with("user")
2929 2929
2930 with self.subTest(action="print_orders"),\ 2930 with self.subTest(action="print_orders"),\
2931 mock.patch("helper.print_orders") as print_orders: 2931 mock.patch("helper.print_orders") as print_orders,\
2932 helper.main_process_market("user", "print_orders") 2932 mock.patch("helper.print_balances") as print_balances:
2933 helper.main_process_market("user", ["print_orders", "print_balances"])
2933 2934
2934 buy.assert_not_called() 2935 buy.assert_not_called()
2935 wait.assert_not_called() 2936 wait.assert_not_called()
2936 sell.assert_not_called() 2937 sell.assert_not_called()
2937 print_orders.assert_called_once_with("user") 2938 print_orders.assert_called_once_with("user")
2939 print_balances.assert_called_once_with("user")
2938 2940
2939 with self.subTest(action="unknown"),\ 2941 with self.subTest(action="unknown"),\
2940 self.assertRaises(NotImplementedError): 2942 self.assertRaises(NotImplementedError):
2941 helper.main_process_market("user", "unknown") 2943 helper.main_process_market("user", ["unknown"])
2942 2944
2943 @mock.patch.object(helper, "psycopg2") 2945 @mock.patch.object(helper, "psycopg2")
2944 def test_fetch_markets(self, psycopg2): 2946 def test_fetch_markets(self, psycopg2):