|
| 1 | +import unittest |
1 | 2 | from pathlib import Path |
2 | 3 |
|
3 | 4 | ROOT = Path(__file__).resolve().parents[1] |
4 | 5 |
|
5 | 6 |
|
6 | | -def test_required_files_exist(): |
7 | | - required = [ |
8 | | - 'README.md', |
9 | | - 'CONTRIBUTING.md', |
10 | | - 'SECURITY.md', |
11 | | - 'GOVERNANCE.md', |
12 | | - 'VERSIONING.md', |
13 | | - 'docs/methodology/continuous-improvement-loop.md', |
14 | | - 'docs/loops/feature.md', |
15 | | - 'prompts/master-system-prompt.md', |
16 | | - ] |
17 | | - missing = [p for p in required if not (ROOT / p).exists()] |
18 | | - assert not missing |
| 7 | +class RequiredStructureTests(unittest.TestCase): |
| 8 | + def test_required_files_exist(self): |
| 9 | + required = [ |
| 10 | + 'README.md', |
| 11 | + 'CONTRIBUTING.md', |
| 12 | + 'SECURITY.md', |
| 13 | + 'GOVERNANCE.md', |
| 14 | + 'VERSIONING.md', |
| 15 | + 'docs/methodology/continuous-improvement-loop.md', |
| 16 | + 'docs/loops/feature.md', |
| 17 | + 'prompts/master-system-prompt.md', |
| 18 | + 'wiki/Home.md', |
| 19 | + ] |
| 20 | + missing = [p for p in required if not (ROOT / p).exists()] |
| 21 | + self.assertEqual([], missing) |
19 | 22 |
|
| 23 | + def test_markdown_files_have_titles(self): |
| 24 | + for path in ROOT.rglob('*.md'): |
| 25 | + text = path.read_text(encoding='utf-8') |
| 26 | + self.assertTrue(text.lstrip().startswith('#'), str(path.relative_to(ROOT))) |
20 | 27 |
|
21 | | -def test_markdown_files_have_titles(): |
22 | | - for path in ROOT.rglob('*.md'): |
23 | | - assert path.read_text(encoding='utf-8').lstrip().startswith('#'), path |
| 28 | + def test_key_docs_have_mermaid(self): |
| 29 | + required = [ |
| 30 | + 'docs/methodology/continuous-improvement-loop.md', |
| 31 | + 'docs/diagrams/README.md', |
| 32 | + 'docs/loops/feature.md', |
| 33 | + 'wiki/Home.md', |
| 34 | + ] |
| 35 | + missing = [p for p in required if '```mermaid' not in (ROOT / p).read_text(encoding='utf-8')] |
| 36 | + self.assertEqual([], missing) |
| 37 | + |
| 38 | + |
| 39 | +if __name__ == '__main__': |
| 40 | + unittest.main() |
0 commit comments