chatgpt2api / test /test_chat_page_model_picker.py
tx1538's picture
Upload 179 files
9d7ddb9 verified
Raw
History Blame
890 Bytes
from __future__ import annotations
import unittest
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
CHAT_PAGE = ROOT / "web" / "src" / "app" / "chat" / "page.tsx"
class ChatPageModelPickerTests(unittest.TestCase):
def source(self) -> str:
return CHAT_PAGE.read_text(encoding="utf-8")
def test_chat_page_loads_models_from_v1_models(self) -> None:
source = self.source()
self.assertIn("modelsEndpoint(", source)
self.assertIn("loadModels", source)
self.assertIn("/models", source)
self.assertIn("setModelOptions", source)
def test_chat_page_renders_model_select_items(self) -> None:
source = self.source()
self.assertIn("SelectContent", source)
self.assertIn("SelectItem", source)
self.assertIn("modelOptions.map", source)
if __name__ == "__main__":
unittest.main()