aboutsummaryrefslogtreecommitdiff
path: root/tests/test_store.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_store.py')
-rw-r--r--tests/test_store.py32
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/test_store.py b/tests/test_store.py
index 58e76e0..d7620a0 100644
--- a/tests/test_store.py
+++ b/tests/test_store.py
@@ -392,7 +392,6 @@ class BalanceStoreTest(WebMockTestCase):
392 type='type') 392 type='type')
393 393
394 balance_store = market.BalanceStore(self.m) 394 balance_store = market.BalanceStore(self.m)
395
396 with self.subTest(add_portfolio=True),\ 395 with self.subTest(add_portfolio=True),\
397 mock.patch.object(market.Portfolio, "repartition") as repartition: 396 mock.patch.object(market.Portfolio, "repartition") as repartition:
398 repartition.return_value = { 397 repartition.return_value = {
@@ -402,6 +401,37 @@ class BalanceStoreTest(WebMockTestCase):
402 balance_store.fetch_balances(add_portfolio=True) 401 balance_store.fetch_balances(add_portfolio=True)
403 self.assertListEqual(["USDT", "XVG", "XMR", "DOGE"], list(balance_store.currencies())) 402 self.assertListEqual(["USDT", "XVG", "XMR", "DOGE"], list(balance_store.currencies()))
404 403
404 self.m.ccxt.fetch_all_balances.return_value = {
405 "ETC": {
406 "exchange_free": 0,
407 "exchange_used": 0,
408 "exchange_total": 0,
409 "margin_total": 0,
410 },
411 "XVG": {
412 "exchange_free": 16,
413 "exchange_used": 0,
414 "exchange_total": 16,
415 "margin_total": 0,
416 },
417 "XMR": {
418 "exchange_free": 0,
419 "exchange_used": 0,
420 "exchange_total": 0,
421 "margin_total": D("-1.0"),
422 "margin_free": 0,
423 },
424 }
425
426 balance_store = market.BalanceStore(self.m)
427 with self.subTest(add_usdt=True),\
428 mock.patch.object(market.Portfolio, "repartition") as repartition:
429 repartition.return_value = {
430 "DOGE": D("0.5"),
431 "ETH": D("0.5"),
432 }
433 balance_store.fetch_balances(add_usdt=True)
434 self.assertListEqual(["XVG", "XMR", "USDT"], list(balance_store.currencies()))
405 435
406 @mock.patch.object(market.Portfolio, "repartition") 436 @mock.patch.object(market.Portfolio, "repartition")
407 def test_dispatch_assets(self, repartition): 437 def test_dispatch_assets(self, repartition):