- balance_store.fetch_balances()
- self.assertNotIn("ETC", balance_store.currencies())
- self.assertListEqual(["USDT", "XVG", "XMR"], list(balance_store.currencies()))
-
- balance_store.all["ETC"] = portfolio.Balance("ETC", {
- "exchange_total": "1", "exchange_free": "0",
- "exchange_used": "1" })
- balance_store.fetch_balances(tag="foo")
- self.assertEqual(0, balance_store.all["ETC"].total)
- self.assertListEqual(["USDT", "XVG", "XMR", "ETC"], list(balance_store.currencies()))
- self.m.report.log_balances.assert_called_with(tag="foo")
+ with self.subTest(log_tickers=False):
+ balance_store.fetch_balances()
+ self.assertNotIn("ETC", balance_store.currencies())
+ self.assertListEqual(["USDT", "XVG", "XMR"], list(balance_store.currencies()))
+
+ balance_store.all["ETC"] = portfolio.Balance("ETC", {
+ "exchange_total": "1", "exchange_free": "0",
+ "exchange_used": "1" })
+ balance_store.fetch_balances(tag="foo")
+ self.assertEqual(0, balance_store.all["ETC"].total)
+ self.assertListEqual(["USDT", "XVG", "XMR", "ETC"], list(balance_store.currencies()))
+ self.m.report.log_balances.assert_called_with(tag="foo")
+
+ with self.subTest(log_tickers=True),\
+ mock.patch.object(balance_store, "in_currency") as in_currency:
+ in_currency.return_value = "tickers"
+ balance_store.fetch_balances(log_tickers=True, ticker_currency="FOO",
+ ticker_compute_value="compute", ticker_type="type")
+ self.m.report.log_balances.assert_called_with(compute_value='compute',
+ tag=None, ticker_currency='FOO', tickers='tickers',
+ type='type')