mirror of
https://github.com/283375/arcaea-offline.git
synced 2025-07-01 20:26:27 +00:00
fix: adapt to new model and tests
- I actually forgot I wrote tests lol
This commit is contained in:
@ -6,7 +6,7 @@ from arcaea_offline.constants.enums.arcaea import (
|
||||
ArcaeaPlayResultModifier,
|
||||
ArcaeaRatingClass,
|
||||
)
|
||||
from arcaea_offline.database.models.play_results import PlayResult
|
||||
from arcaea_offline.database.models.play_result import PlayResult
|
||||
from arcaea_offline.external.importers.arcaea.online import ArcaeaOnlineApiParser
|
||||
|
||||
API_RESULT = {
|
||||
@ -80,9 +80,9 @@ class TestArcaeaOnlineApiParser:
|
||||
assert test1.pure == 1234
|
||||
assert test1.far == 12
|
||||
assert test1.lost == 4
|
||||
assert test1.date == datetime(2024, 1, 1, 0, 0, 0, tzinfo=timezone.utc)
|
||||
assert test1.played_at == datetime(2024, 1, 1, 0, 0, 0, tzinfo=timezone.utc)
|
||||
assert test1.clear_type is ArcaeaPlayResultClearType.NORMAL_CLEAR
|
||||
assert test1.modifier is ArcaeaPlayResultModifier.NORMAL
|
||||
|
||||
test2 = next(filter(lambda x: x.song_id == "test2", play_results))
|
||||
assert test2.date == datetime(2024, 1, 2, 0, 0, 0, tzinfo=timezone.utc)
|
||||
assert test2.played_at == datetime(2024, 1, 2, 0, 0, 0, tzinfo=timezone.utc)
|
||||
|
4
tests/external/importers/arcaea/test_st3.py
vendored
4
tests/external/importers/arcaea/test_st3.py
vendored
@ -31,7 +31,7 @@ class TestArcaeaSt3Parser:
|
||||
assert test1.pure == 895
|
||||
assert test1.far == 32
|
||||
assert test1.lost == 22
|
||||
assert test1.date == datetime.fromtimestamp(1722100000).astimezone()
|
||||
assert test1.played_at == datetime.fromtimestamp(1722100000).astimezone()
|
||||
assert test1.clear_type is ArcaeaPlayResultClearType.TRACK_LOST
|
||||
assert test1.modifier is ArcaeaPlayResultModifier.HARD
|
||||
|
||||
@ -48,7 +48,7 @@ class TestArcaeaSt3Parser:
|
||||
assert corrupt2.modifier is None
|
||||
|
||||
date1 = next(filter(lambda x: x.song_id == "date1", play_results))
|
||||
assert date1.date is None
|
||||
assert date1.played_at is None
|
||||
|
||||
def test_invalid_input(self):
|
||||
pytest.raises(TypeError, ArcaeaSt3Parser.parse, "abcdefghijklmn")
|
||||
|
Reference in New Issue
Block a user