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 )