1
0
personal-data/test/test_csv_import.py

25 lines
635 B
Python
Raw Normal View History

import datetime
2024-10-13 13:20:30 +00:00
import frozendict
from personal_data.csv_import import determine_possible_keys
def test_determine_possible_keys():
2024-10-13 13:20:30 +00:00
data = frozendict.frozendict(
{
'game.name': 'Halo',
'me.last_played_time': datetime.datetime(
2021, 6, 13, 19, 12, 21, tzinfo=datetime.timezone.utc,
),
'trophy.name': 'Test',
'trophy.desc': 'Description',
},
)
keys = determine_possible_keys(data)
assert keys.time_start == []
assert keys.time_end == ['me.last_played_time']
assert keys.duration == []
assert len(keys.name) == 3