1
0
personal-data/test/test_kucoin.py
Jon Michael Aanes 53f307e40c
All checks were successful
Build container / Package-Python (push) Successful in 23s
Build container / Package-Container (push) Successful in 1m19s
Kucoin coverage
2024-05-18 22:03:34 +02:00

38 lines
1.2 KiB
Python

from frozendict import frozendict
from personal_data.fetchers.defi_kucoin import addresses_to_data_points
def test_addresses_to_data_points_none():
data_point = addresses_to_data_points([])
assert data_point['account.update_time'] is not None
expected = {
'account.num_deposit_addresses': 0,
'account.update_time': data_point['account.update_time'],
}
assert data_point == frozendict(expected)
def test_addresses_to_data_points_one():
data_point = addresses_to_data_points([{'a': 1, 'b': 2}])
assert data_point['account.update_time'] is not None
expected = {
'account.num_deposit_addresses': 1,
'account.update_time': data_point['account.update_time'],
'deposit.a': 1,
'deposit.b': 2,
}
assert data_point == frozendict(expected)
def test_addresses_to_data_points_two():
data_point = addresses_to_data_points([{'a': 1, 'b': 2}, {'a': 4, 'b': 9}])
assert data_point['account.update_time'] is not None
expected = {
'account.num_deposit_addresses': 2,
'account.update_time': data_point['account.update_time'],
'deposit.a': 4,
'deposit.b': 9,
}
assert data_point == frozendict(expected)