feat(mcp): instructions OAuth Claude.ai/ChatGPT sur /compte/mcp (#114)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -22,3 +22,32 @@ def test_page_module_registers_and_builds_client_instructions():
|
||||
assert "https://colibre.fr/_mcp" in text
|
||||
for client_name in ("Claude", "Gemini", "Mistral", "ChatGPT"):
|
||||
assert client_name in text
|
||||
|
||||
|
||||
def test_client_instructions_include_oauth_apps():
|
||||
from src.app import app # noqa: F401
|
||||
from src.pages.compte.mcp import client_instructions
|
||||
|
||||
comp = client_instructions("https://colibre.fr/_mcp", "<VOTRE_JETON>")
|
||||
titles = _collect_titles(comp)
|
||||
assert any("Claude.ai" in t for t in titles)
|
||||
assert any("ChatGPT" in t for t in titles)
|
||||
|
||||
|
||||
def _collect_titles(component):
|
||||
# Parcourt récursivement les AccordionItem pour collecter leurs `title`.
|
||||
found = []
|
||||
|
||||
def walk(node):
|
||||
title = getattr(node, "title", None)
|
||||
if isinstance(title, str):
|
||||
found.append(title)
|
||||
children = getattr(node, "children", None)
|
||||
if isinstance(children, (list, tuple)):
|
||||
for c in children:
|
||||
walk(c)
|
||||
elif children is not None:
|
||||
walk(children)
|
||||
|
||||
walk(component)
|
||||
return found
|
||||
|
||||
Reference in New Issue
Block a user