test_milestones.py
python · 14 lines · Exact bytes
Version & provenance · evaluation-cm7
Recorded SHA-256 5a41203d4883179325e911e5cb2bc28fa65b7113a8993098aff9576811d2893eRendered SHA-256 5a41203d4883179325e911e5cb2bc28fa65b7113a8993098aff9576811d2893e
Apache-2.0 original project code; dependencies retain their own licenses. License notes. Line links are stable within this snapshot. CM-7 completed implementation source; original and public rendered hashes recorded. Host-specific paths use /work placeholders; inspect reproduction instructions before running. Separate Rust helper retains its GPL license.
1import unittest
2from checkpoint_gate import validate_milestone
3class Tests(unittest.TestCase):
4 def test_exact_milestone_formats(self):
5 cases=[(None,'cm7-theory-completion-v1',3000),('prepass','cm7-theory-followup-v1',0),('update-1500','cm7-theory-recovery-v1',1500)]
6 for mode,fmt,step in cases:
7 c={} if mode is None else {'diagnostic_milestone':mode};validate_milestone({'format':fmt,'updates':step},c)
8 with self.assertRaises(ValueError):validate_milestone({'format':'wrong','updates':step},c)
9 if mode:
10 with self.assertRaises(ValueError):validate_milestone({'format':fmt,'updates':step+1},c)
11 def test_undeclared_checkpoint_refused(self):
12 with self.assertRaises(ValueError):validate_milestone({'format':'cm7-theory-recovery-v1','updates':250},{'diagnostic_milestone':'update-250'})
13if __name__=='__main__':unittest.main()
14