Files
timmy-home/tests/test_fleet_ops_genome.py
2026-04-15 21:36:08 -04:00

60 lines
1.9 KiB
Python

from pathlib import Path
import unittest
ROOT = Path(__file__).resolve().parent.parent
GENOME_PATH = ROOT / "genomes" / "fleet-ops-GENOME.md"
class TestFleetOpsGenome(unittest.TestCase):
def test_genome_file_exists_with_required_sections(self):
self.assertTrue(GENOME_PATH.exists(), "missing genomes/fleet-ops-GENOME.md")
text = GENOME_PATH.read_text(encoding="utf-8")
required_sections = [
"# GENOME.md — fleet-ops",
"## Project Overview",
"## Architecture",
"## Entry Points",
"## Data Flow",
"## Key Abstractions",
"## API Surface",
"## Test Coverage Gaps",
"## Security Considerations",
"## Deployment",
]
for section in required_sections:
self.assertIn(section, text)
def test_genome_names_real_files_and_grounded_findings(self):
text = GENOME_PATH.read_text(encoding="utf-8")
required_snippets = [
"```mermaid",
"playbooks/site.yml",
"playbooks/deploy_hermes.yml",
"scripts/deploy-hook.py",
"scripts/dispatch_consumer.py",
"message_bus.py",
"knowledge_store.py",
"health_dashboard.py",
"registry.yaml",
"manifest.yaml",
"DEPLOY_HOOK_SECRET",
"gitea_register_act_runner: false",
"gitea_webhook_allowed_host_list",
"tests/test_video_engine_client.py",
"158 passed, 1 failed, 2 errors",
"hermes_tools",
"8643",
"8646",
]
for snippet in required_snippets:
self.assertIn(snippet, text)
def test_genome_is_substantial(self):
text = GENOME_PATH.read_text(encoding="utf-8")
self.assertGreaterEqual(len(text.splitlines()), 120)
self.assertGreaterEqual(len(text), 7000)
if __name__ == "__main__":
unittest.main()