mirror of
https://github.com/283375/arcaea-offline.git
synced 2025-04-19 06:00:18 +00:00
chore: rename database external arcaea parsers
This commit is contained in:
parent
864f524e68
commit
bb163ad78d
@ -26,7 +26,7 @@ class ArcaeaListParser:
|
|||||||
self.list_text = list_text
|
self.list_text = list_text
|
||||||
|
|
||||||
|
|
||||||
class PacklistParser(ArcaeaListParser):
|
class ArcaeaPacklistParser(ArcaeaListParser):
|
||||||
def parse(self) -> List[Union[Pack, PackLocalized]]:
|
def parse(self) -> List[Union[Pack, PackLocalized]]:
|
||||||
root = json.loads(self.list_text)
|
root = json.loads(self.list_text)
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ class PacklistParser(ArcaeaListParser):
|
|||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
class SonglistParser(ArcaeaListParser):
|
class ArcaeaSonglistParser(ArcaeaListParser):
|
||||||
def parse_songs(self) -> List[Union[Song, SongLocalized, SongSearchWord]]:
|
def parse_songs(self) -> List[Union[Song, SongLocalized, SongSearchWord]]:
|
||||||
root = json.loads(self.list_text)
|
root = json.loads(self.list_text)
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ from .common import fix_timestamp
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class St3Parser:
|
class ArcaeaSt3Parser:
|
||||||
@classmethod
|
@classmethod
|
||||||
@overload
|
@overload
|
||||||
def parse(cls, db: sqlite3.Connection) -> List[PlayResult]: ...
|
def parse(cls, db: sqlite3.Connection) -> List[PlayResult]: ...
|
||||||
|
8
tests/external/importers/arcaea/test_st3.py
vendored
8
tests/external/importers/arcaea/test_st3.py
vendored
@ -7,7 +7,7 @@ from arcaea_offline.constants.enums.arcaea import (
|
|||||||
ArcaeaPlayResultModifier,
|
ArcaeaPlayResultModifier,
|
||||||
ArcaeaRatingClass,
|
ArcaeaRatingClass,
|
||||||
)
|
)
|
||||||
from arcaea_offline.external.importers.arcaea.st3 import St3Parser
|
from arcaea_offline.external.importers.arcaea.st3 import ArcaeaSt3Parser
|
||||||
|
|
||||||
import tests.resources
|
import tests.resources
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ class TestSt3Parser:
|
|||||||
@property
|
@property
|
||||||
def play_results(self):
|
def play_results(self):
|
||||||
conn = sqlite3.connect(str(self.DB_PATH))
|
conn = sqlite3.connect(str(self.DB_PATH))
|
||||||
return St3Parser.parse(conn)
|
return ArcaeaSt3Parser.parse(conn)
|
||||||
|
|
||||||
def test_basic(self):
|
def test_basic(self):
|
||||||
play_results = self.play_results
|
play_results = self.play_results
|
||||||
@ -51,5 +51,5 @@ class TestSt3Parser:
|
|||||||
assert date1.date is None
|
assert date1.date is None
|
||||||
|
|
||||||
def test_invalid_input(self):
|
def test_invalid_input(self):
|
||||||
pytest.raises(TypeError, St3Parser.parse, "abcdefghijklmn")
|
pytest.raises(TypeError, ArcaeaSt3Parser.parse, "abcdefghijklmn")
|
||||||
pytest.raises(TypeError, St3Parser.parse, 123456)
|
pytest.raises(TypeError, ArcaeaSt3Parser.parse, 123456)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user