33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
import json
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
|
|
REPOSITORY = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
class OpenCodeProjectConfigurationTests(unittest.TestCase):
|
|
def test_declares_only_the_factory_provider_lanes_and_role_agents(self):
|
|
config = json.loads((REPOSITORY / "opencode.json").read_text())
|
|
|
|
self.assertEqual(config["share"], "disabled")
|
|
self.assertEqual(
|
|
config["enabled_providers"],
|
|
["openai", "zai-coding-plan", "minimax", "deepseek"],
|
|
)
|
|
expected_models = {
|
|
"factory-planner.md": "zai-coding-plan/glm-5.2",
|
|
"factory-builder.md": "openai/gpt-5.3-codex",
|
|
"factory-reviewer.md": "minimax/MiniMax-M3",
|
|
"factory-scout.md": "minimax/MiniMax-M3",
|
|
}
|
|
for filename, model in expected_models.items():
|
|
document = (REPOSITORY / ".opencode/agents" / filename).read_text()
|
|
frontmatter = document.split("---", 2)[1]
|
|
self.assertIn(f"model: {model}", frontmatter)
|
|
self.assertIn("description:", frontmatter)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|