Skip to content

Commit 87755b3

Browse files
committed
tests: make structure tests runnable with unittest
1 parent e2fa3a9 commit 87755b3

1 file changed

Lines changed: 33 additions & 16 deletions

File tree

tests/test_required_structure.py

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,40 @@
1+
import unittest
12
from pathlib import Path
23

34
ROOT = Path(__file__).resolve().parents[1]
45

56

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)
1922

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)))
2027

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

Comments
 (0)