1
0

Added kraken and kucoin tests

This commit is contained in:
Jon Michael Aanes 2024-07-20 20:19:52 +02:00
parent 7a5ebae6ff
commit 1903d55038
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA
3 changed files with 59 additions and 0 deletions

View File

@ -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 from secret_loader import SecretLoader
load_secret = SecretLoader().load load_secret = SecretLoader().load
NORDNET_USERNAME = load_secret('NORDNET_USERNAME') NORDNET_USERNAME = load_secret('NORDNET_USERNAME')
NORDNET_PASSWORD = load_secret('NORDNET_PASSWORD') 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
View 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
View 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