Added kraken and kucoin tests
This commit is contained in:
parent
7a5ebae6ff
commit
1903d55038
|
@ -1,6 +1,20 @@
|
|||
"""Secret loading for tests.
|
||||
|
||||
Add these secrets to an [appropriate secret loader
|
||||
location](https://gitfub.space/Jmaa/secret_loader). Missing some secrets will
|
||||
result in skipped tests.
|
||||
"""
|
||||
|
||||
from secret_loader import SecretLoader
|
||||
|
||||
load_secret = SecretLoader().load
|
||||
|
||||
NORDNET_USERNAME = load_secret('NORDNET_USERNAME')
|
||||
NORDNET_PASSWORD = load_secret('NORDNET_PASSWORD')
|
||||
|
||||
KRAKEN_KEY = load_secret('KRAKEN_KEY')
|
||||
KRAKEN_SECRET = load_secret('KRAKEN_SECRET')
|
||||
|
||||
KUCOIN_KEY = load_secret('KUCOIN_KEY')
|
||||
KUCOIN_SECRET = load_secret('KUCOIN_SECRET')
|
||||
KUCOIN_PASS = load_secret('KUCOIN_PASS')
|
||||
|
|
22
test/test_kraken.py
Normal file
22
test/test_kraken.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
import pytest
|
||||
import requests
|
||||
|
||||
from fin_depo import data, defi_kraken
|
||||
|
||||
from . import secrets
|
||||
|
||||
needs_secrets = pytest.mark.skipif(
|
||||
not secrets.KRAKEN_KEY,
|
||||
reason='Secret kraken_USERNAME required',
|
||||
)
|
||||
|
||||
@needs_secrets
|
||||
def test_get_depo():
|
||||
session = requests.Session()
|
||||
fetcher = defi_kraken.KrakenDepoFetcher(
|
||||
secrets.KRAKEN_KEY,
|
||||
secrets.KRAKEN_SECRET,
|
||||
)
|
||||
|
||||
depo = fetcher.get_depo()
|
||||
assert depo is not None
|
23
test/test_kucoin.py
Normal file
23
test/test_kucoin.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
import pytest
|
||||
import requests
|
||||
|
||||
from fin_depo import data, defi_kucoin
|
||||
|
||||
from . import secrets
|
||||
|
||||
needs_secrets = pytest.mark.skipif(
|
||||
not secrets.KUCOIN_KEY,
|
||||
reason='Secret kucoin_USERNAME required',
|
||||
)
|
||||
|
||||
@needs_secrets
|
||||
def test_get_depo():
|
||||
session = requests.Session()
|
||||
fetcher = defi_kucoin.KucoinDepoFetcher(
|
||||
secrets.KUCOIN_KEY,
|
||||
secrets.KUCOIN_SECRET,
|
||||
secrets.KUCOIN_PASS,
|
||||
)
|
||||
|
||||
depo = fetcher.get_depo()
|
||||
assert depo is not None
|
Loading…
Reference in New Issue
Block a user