1
0
fin-depo/test/test_kraken.py

49 lines
991 B
Python
Raw Normal View History

2024-07-20 18:19:52 +00:00
import pytest
2024-07-21 09:09:49 +00:00
import fin_depo
2024-07-20 18:19:52 +00:00
from . import secrets
needs_secrets = pytest.mark.skipif(
not secrets.KRAKEN_KEY,
reason='Secret kraken_USERNAME required',
)
2024-12-22 03:48:31 +00:00
def get_fetcher():
return fin_depo.defi_kraken.KrakenDepoFetcher(
2024-07-20 18:19:52 +00:00
secrets.KRAKEN_KEY,
secrets.KRAKEN_SECRET,
)
2024-12-22 03:48:31 +00:00
@needs_secrets
def test_get_depo():
"""Can inspect depository."""
depo = get_fetcher().get_depo()
2024-07-21 09:09:49 +00:00
assert isinstance(depo, fin_depo.data.DepoSingle)
2024-12-22 03:48:31 +00:00
@needs_secrets
def test_get_withdrawals():
withdrawals = get_fetcher()._get_withdrawals()
assert len(withdrawals) > 0
@needs_secrets
def test_get_deposits():
deposits = get_fetcher()._get_deposits()
assert len(deposits) > 0
@needs_secrets
def test_get_historic_spot_orders():
orders = get_fetcher()._get_historic_spot_orders()
assert next(orders)
@needs_secrets
def test_get_double_registers():
double_registers = get_fetcher()._get_double_registers()
assert len(double_registers) > 0