added
This commit is contained in:
1 parent
557d535b48
commit
ee596a9fff
42 files changed
+2262
-1
No files matched your search
@@ -0,0 +1,7 @@
|
||||
# Tests
|
||||
|
||||
Run the lightweight repository tests with:
|
||||
|
||||
```text
|
||||
python -m unittest discover -s tests -p "test_*.py"
|
||||
```
|
||||
@@ -0,0 +1,34 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
SPEC = importlib.util.spec_from_file_location(
|
||||
"validate_repository", ROOT / "scripts" / "validate_repository.py"
|
||||
)
|
||||
VALIDATOR = importlib.util.module_from_spec(SPEC)
|
||||
assert SPEC.loader is not None
|
||||
SPEC.loader.exec_module(VALIDATOR)
|
||||
|
||||
|
||||
class RepositoryTests(unittest.TestCase):
|
||||
def test_repository_passes(self) -> None:
|
||||
self.assertEqual([], VALIDATOR.validate(ROOT))
|
||||
|
||||
def test_every_markdown_report_is_indexed(self) -> None:
|
||||
import json
|
||||
|
||||
index = json.loads((ROOT / "content-index.json").read_text(encoding="utf-8"))
|
||||
indexed = {item["path"] for item in index["items"]}
|
||||
reports = {
|
||||
path.relative_to(ROOT).as_posix()
|
||||
for path in (ROOT / "research-results").glob("*ai-opportunity-skill-results.md")
|
||||
}
|
||||
self.assertEqual(reports, indexed)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user