]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git/blobdiff - test.py
Dynamically use process methods
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git] / test.py
diff --git a/test.py b/test.py
index fbc857dbc64729a7969c9f0655b312c5827fd967..14b5559a354fb173e26f3966c31b600b1c1eeaae 100644 (file)
--- a/test.py
+++ b/test.py
@@ -2920,7 +2920,7 @@ class HelperTest(WebMockTestCase):
         sell.reset_mock()
         with self.subTest(action="print_balances"),\
                 mock.patch("helper.print_balances") as print_balances:
-            helper.main_process_market("user", "print_balances")
+            helper.main_process_market("user", ["print_balances"])
 
             buy.assert_not_called()
             wait.assert_not_called()
@@ -2928,17 +2928,19 @@ class HelperTest(WebMockTestCase):
             print_balances.assert_called_once_with("user")
 
         with self.subTest(action="print_orders"),\
-                mock.patch("helper.print_orders") as print_orders:
-            helper.main_process_market("user", "print_orders")
+                mock.patch("helper.print_orders") as print_orders,\
+                mock.patch("helper.print_balances") as print_balances:
+            helper.main_process_market("user", ["print_orders", "print_balances"])
 
             buy.assert_not_called()
             wait.assert_not_called()
             sell.assert_not_called()
             print_orders.assert_called_once_with("user")
+            print_balances.assert_called_once_with("user")
 
         with self.subTest(action="unknown"),\
                 self.assertRaises(NotImplementedError):
-            helper.main_process_market("user", "unknown")
+            helper.main_process_market("user", ["unknown"])
 
     @mock.patch.object(helper, "psycopg2")
     def test_fetch_markets(self, psycopg2):