Files
comfyui_o1key/tests/test_chat_panel.py
T
Jony ba920f2b66 Publish current ComfyUI O1Key code baseline
Replace the prior release tree with the current plugin, frontend, tests, and documentation. Document retired node IDs and the public Gitea update source.
2026-09-24 19:56:48 +08:00

29 lines
986 B
Python

import re
import unittest
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
class ChatPanelModelTests(unittest.TestCase):
def test_gpt_6_astra_is_the_frontend_and_proxy_default(self):
frontend = (ROOT / "web" / "js" / "chatPanel.js").read_text(encoding="utf-8")
backend = (ROOT / "__init__.py").read_text(encoding="utf-8")
self.assertIn('const DEFAULT_MODEL = "gpt-6-sol";', frontend)
self.assertIn("let currentModel = DEFAULT_MODEL;", frontend)
models = re.search(r"const MODELS = \[(.*?)\];", frontend, re.DOTALL)
self.assertIsNotNone(models)
self.assertEqual(models.group(1).strip().splitlines()[0].strip(), "DEFAULT_MODEL,")
self.assertIn('data.get("model", "gpt-6-sol")', backend)
self.assertRegex(
backend,
r'elif model in \([^\n]*"gpt-6-sol"[^\n]*\):\n\s+body\["reasoning_effort"\] = reasoning',
)
if __name__ == "__main__":
unittest.main()