38 lines
1.2 KiB
Python
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)
|