1
0
fin-depo/test/test_kraken.py

49 lines
991 B
Python

import pytest
import fin_depo
from . import secrets
needs_secrets = pytest.mark.skipif(
not secrets.KRAKEN_KEY,
reason='Secret kraken_USERNAME required',
)
def get_fetcher():
return fin_depo.defi_kraken.KrakenDepoFetcher(
secrets.KRAKEN_KEY,
secrets.KRAKEN_SECRET,
)
@needs_secrets
def test_get_depo():
"""Can inspect depository."""
depo = get_fetcher().get_depo()
assert isinstance(depo, fin_depo.data.DepoSingle)
@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