test: add test for kraken balance response parsing

part of #11118
This commit is contained in:
Matthias
2025-01-05 11:21:15 +01:00
parent 5f0df2c1de
commit 4f1bf6a1f0
2 changed files with 30 additions and 0 deletions
+13
View File
@@ -114,6 +114,19 @@ class TestCCXTExchange:
else:
pytest.skip(f"No sample Trades available for exchange {exchange_name}")
def test_ccxt_balances_parse(self, exchange: EXCHANGE_FIXTURE_TYPE):
exch, exchange_name = exchange
if balance_response := EXCHANGES[exchange_name].get("sample_balances"):
balances = exch._api.parse_balance(balance_response["exchange_response"])
expected = balance_response["expected"]
for currency, balance in expected.items():
assert currency in balances
assert isinstance(balance, dict)
assert balance == balances[currency]
pass
else:
pytest.skip(f"No sample Balances available for exchange {exchange_name}")
def test_ccxt_fetch_tickers(self, exchange: EXCHANGE_FIXTURE_TYPE):
exch, exchangename = exchange
pair = EXCHANGES[exchangename]["pair"]