mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-10 13:33:24 -05:00
fix: accept verified_members in pack manifests
This commit is contained in:
1 parent
b788078590
commit
70bd093a59
2 files changed
+20
-1
No files matched your search
@@ -21,7 +21,7 @@
|
|||||||
"sha1": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
|
"sha1": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
|
||||||
"md5": { "type": "string", "pattern": "^[a-f0-9]{32}$" },
|
"md5": { "type": "string", "pattern": "^[a-f0-9]{32}$" },
|
||||||
"size": { "type": "integer", "minimum": 0 },
|
"size": { "type": "integer", "minimum": 0 },
|
||||||
"status": { "enum": ["verified", "verified_md5", "verified_rebuild", "verified_data", "untracked"] },
|
"status": { "enum": ["verified", "verified_md5", "verified_rebuild", "verified_data", "verified_members", "untracked"] },
|
||||||
"name": { "type": "string" }
|
"name": { "type": "string" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,5 +42,24 @@ class MembersMustBeKnown(unittest.TestCase):
|
|||||||
self.assertTrue(any("garbled.bin" in e for e in manifest["errors"]))
|
self.assertTrue(any("garbled.bin" in e for e in manifest["errors"]))
|
||||||
|
|
||||||
|
|
||||||
|
class SchemaAcceptsEveryStatus(unittest.TestCase):
|
||||||
|
"""verified_members reached every pack manifest and the schema refused it."""
|
||||||
|
|
||||||
|
def test_each_status_packverify_writes_is_in_the_schema(self):
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
|
source = (REPO_ROOT / "scripts" / "packverify.py").read_text(encoding="utf-8")
|
||||||
|
written = set(re.findall(r'status = "([a-z_]+)"', source))
|
||||||
|
schema = json.loads(
|
||||||
|
(REPO_ROOT / "schemas" / "pack-manifest.schema.json").read_text(encoding="utf-8")
|
||||||
|
)
|
||||||
|
allowed = set(
|
||||||
|
schema["properties"]["files"]["items"]["properties"]["status"]["enum"]
|
||||||
|
)
|
||||||
|
self.assertTrue(written)
|
||||||
|
self.assertEqual(sorted(written - allowed), [])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
Reference in new issue
Block a user