Files
arcaea-apk-assets/tests/test_packlist.py
2025-07-05 14:27:26 +08:00

28 lines
844 B
Python

import pytest
from arcaea_apk_assets.parsers.packlist import ArcaeaPacklistParser, PacklistFormatError
from tests.contents import packlist as contents
class TestPacklistParser:
def test_normal(self):
content = contents.NORMAL
ArcaeaPacklistParser.packs(content)
def test_malformed(self):
with pytest.raises(PacklistFormatError, match="does not exist"):
ArcaeaPacklistParser.items(contents.MALFORMED_WTF)
with pytest.raises(PacklistFormatError, match="got"):
ArcaeaPacklistParser.items(contents.MALFORMED_ROOT)
assert (
len(ArcaeaPacklistParser.items(contents.MALFORMED_WTF, skip_asserts=True))
== 0
)
assert (
len(ArcaeaPacklistParser.items(contents.MALFORMED_ROOT, skip_asserts=True))
== 0
)