v3.6.2 同步发版:晚子时不再双重换日、港澳时区归位

- 晚子时(真太阳时 23:00–24:00,约 4% 的盘)修正:换日改由 tyme4py provider 原生实现(cast 新增 sect 参数,1=子初 / 2=子正),排盘层不再自行预滚日。3.6.1 及此前会滚两次,日柱多进一天、时柱随之错干——锚点 1973-08-23 23:32 男:旧 癸巳日壬子时 → 正 壬辰日庚子时。已排过的晚子时盘建议重排核对
- --day-boundary 子正 现真正生效(走 sect=2,晚子时日柱算当天),此前只改审计文案不改实际排盘
- data/cities.json 港澳 28 个条目由 Asia/Shanghai 改为 Asia/Hong_Kong(19)、Asia/Macau(9):大陆 1986–1991 行夏令时而港澳 1979 年后无,沿用上海区会把大陆夏令时错加到港澳命主身上
- 修副本环境 `pytest tests/` 收集期中断(test_sync_tool 模块级加载外层 tools/,skipif 挡不住导入),现按设计整模块 skip
- .gitignore 新增 data/.license.json、data/.update_check.json,本机授权与更新缓存不再可能误入仓
- 测试 178 项全绿(副本内 sync 工具 4 项按设计 skip);manifest 1278 文件,ed25519 签名,公钥指纹 3089bc1cc9a453e5…
This commit is contained in:
2026-10-12 19:05:09 +08:00
parent 415cb472b1
commit b20fd5c3c9
14 changed files with 175 additions and 72 deletions
+31
View File
@@ -50,5 +50,36 @@ class HistoryTzGoldenTest(unittest.TestCase):
)
class HkMoDstTest(unittest.TestCase):
"""香港/澳门时区回归:1986–1991 中国大陆实行夏令时,港澳 1979 年后无;
cities.json 港澳条目必须为 Asia/Hong_Kong / Asia/Macau,不得随大陆拨快。"""
def test_hongkong_1987_no_dst(self):
loc = resolve_location("香港")
_utc, audit = to_utc(datetime(1987, 7, 5, 5, 0), loc)
self.assertEqual(loc.tz, "Asia/Hong_Kong")
self.assertIs(audit["is_dst"], False)
def test_macau_1987_no_dst(self):
loc = resolve_location("澳门")
_utc, audit = to_utc(datetime(1987, 7, 5, 5, 0), loc)
self.assertEqual(loc.tz, "Asia/Macau")
self.assertIs(audit["is_dst"], False)
def test_mainland_1987_dst_kept(self):
# 回归保护:大陆 1987 年夏令时仍应拨快
loc = resolve_location("北京")
_utc, audit = to_utc(datetime(1987, 7, 5, 5, 0), loc)
self.assertIs(audit["is_dst"], True)
def test_hongkong_1970_historical_dst(self):
# 香港 1949 后的历史夏令时(如 1970 年)应被 IANA 库正确处理
# (1949 前走民国五时区历史表分支,不在此断言范围)
loc = resolve_location("香港")
_utc, audit = to_utc(datetime(1970, 7, 15, 12, 0), loc)
self.assertEqual(audit["tz_used"], "Asia/Hong_Kong")
self.assertIs(audit["is_dst"], True)
if __name__ == "__main__":
unittest.main()