@@ -927,7 +927,22 @@ def test_get_balance(self, mock_fetch_balance, mock_logging):
927927 balancer .CONF .test = False
928928 balancer .LOG = mock_logging
929929 balancer .EXCHANGE = balancer .connect_to_exchange ()
930- mock_fetch_balance .return_value = {'XBT.F' : {'used' : None , 'free' : None , 'total' : 0.9 }}
930+ mock_fetch_balance .return_value = {'BTC' : {'used' : None , 'free' : None , 'total' : 0.9 }, 'XBT.F' : {'total' : 0 }}
931+
932+ balance = balancer .get_crypto_balance ()
933+
934+ self .assertEqual (0 , balance ['used' ])
935+ self .assertEqual (0 , balance ['free' ])
936+ self .assertEqual (0.9 , balance ['total' ])
937+
938+ @patch ('balancer.logging' )
939+ @mock .patch .object (ccxt .kraken , 'fetch_balance' )
940+ def test_get_balance_alternative_currency (self , mock_fetch_balance , mock_logging ):
941+ balancer .CONF = self .create_default_conf ()
942+ balancer .CONF .test = False
943+ balancer .LOG = mock_logging
944+ balancer .EXCHANGE = balancer .connect_to_exchange ()
945+ mock_fetch_balance .return_value = {'BTC' : {'total' : 0 }, 'XBT.F' : {'used' : None , 'free' : None , 'total' : 0.9 }}
931946
932947 balance = balancer .get_crypto_balance ()
933948
0 commit comments