This commit is contained in:
2025-07-06 18:43:00 +08:00
parent 155e8b9664
commit bcaa1a268e
9 changed files with 390 additions and 401 deletions

View File

@ -11,17 +11,27 @@ class TestPacklistParser:
ArcaeaPacklistParser.packs(content)
def test_malformed(self):
with pytest.raises(PacklistFormatError, match="does not exist"):
with pytest.raises(PacklistFormatError):
ArcaeaPacklistParser.items(contents.MALFORMED_WTF)
with pytest.raises(PacklistFormatError, match="got"):
with pytest.raises(PacklistFormatError):
ArcaeaPacklistParser.items(contents.MALFORMED_ROOT)
assert (
len(ArcaeaPacklistParser.items(contents.MALFORMED_WTF, skip_asserts=True))
len(
ArcaeaPacklistParser.items(
contents.MALFORMED_WTF,
skip_format_checks=True,
),
)
== 0
)
assert (
len(ArcaeaPacklistParser.items(contents.MALFORMED_ROOT, skip_asserts=True))
len(
ArcaeaPacklistParser.items(
contents.MALFORMED_ROOT,
skip_format_checks=True,
),
)
== 0
)