🐛 fix(test): skip exact zone match without tzdata.zi
- 🐛 minimal containers lack the link table, so the exact china zone check failed on a correct profile Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QuATgjU4mnqpqSLAKMQ14g
This commit is contained in:
1 parent
d9a781e3c9
commit
ec4579a461
1 file changed
+5
-1
@@ -124,6 +124,8 @@ for profile in sorted((Path(os.environ["ROOT"]) / "default/regions").iterdir()):
|
||||
|
||||
# The installer offers tzdata's backward-compatible names too, so China
|
||||
# covers every name that links to its two zones and nothing else.
|
||||
# Without tzdata.zi (minimal containers) only the canonical zones can be
|
||||
# checked, so completeness is enforced where the host has the link table.
|
||||
china = {zone for zone, region in owners.items() if region == "cn"}
|
||||
expected = {"Asia/Shanghai", "Asia/Urumqi"}
|
||||
tzdata = zoneinfo / "tzdata.zi"
|
||||
@@ -132,6 +134,8 @@ if tzdata.is_file():
|
||||
fields = line.split()
|
||||
if len(fields) == 3 and fields[0] == "L" and fields[1] in {"Asia/Shanghai", "Asia/Urumqi"}:
|
||||
expected.add(fields[2])
|
||||
assert china == expected, (china, expected)
|
||||
assert china == expected, (china, expected)
|
||||
else:
|
||||
assert expected <= china, (china, expected)
|
||||
PY
|
||||
pass "region profiles map each timezone to at most one region"
|
||||
Reference in new issue
Block a user