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()
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):