fix: count variant choices made through validated_choice

This commit is contained in:
Abdessamad Derraz committed 2026-10-06 10:23:20 +02:00
1 parent 79cdbc24cf
commit 70d6f431e3
1 file changed
+4 -2
+4 -2
View File
@@ -81,8 +81,10 @@ class OneImplementation(unittest.TestCase):
for name in ("verify.py", "generate_pack.py"): for name in ("verify.py", "generate_pack.py"):
source = (REPO_ROOT / "scripts" / name).read_text(encoding="utf-8") source = (REPO_ROOT / "scripts" / name).read_text(encoding="utf-8")
with self.subTest(module=name): with self.subTest(module=name):
self.assertGreaterEqual(len(re.findall(r"find_validated_variant\(", source)), 2 # Directly or through validated_choice, the one place that
if name == "generate_pack.py" else 3) # picks the variant a destination ships.
calls = re.findall(r"(?:find_validated_variant|validated_choice)\(", source)
self.assertGreaterEqual(len(calls), 2 if name == "generate_pack.py" else 3)
if __name__ == "__main__": if __name__ == "__main__":