v2.14.0 (#743)
Co-authored-by: Alexis Tacnet <alexis@mistral.ai> Co-authored-by: Clément Drouin <clement.drouin@mistral.ai> Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com> Co-authored-by: Lucas Marandat <31749711+lucasmrdt@users.noreply.github.com> Co-authored-by: Maxime Dolores <maxime.dolores@ext.mistral.ai> Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai> Co-authored-by: Quentin <quentin.torroba@mistral.ai> Co-authored-by: Val <102326092+vdeva@users.noreply.github.com> Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com> Co-authored-by: p.vezia <166131032+le-codeur-rapide@users.noreply.github.com> Co-authored-by: Hiba Chaabnia <Hiba-Chaabnia@users.noreply.github.com> Co-authored-by: Nikhil Bhima <nikhilbhima@users.noreply.github.com> Co-authored-by: Nkipohcs <Nkipohcs@users.noreply.github.com> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
ad0d5c9520
commit
3f8487f761
197 changed files with 10819 additions and 2830 deletions
|
|
@ -12,6 +12,7 @@ from tests.stubs.fake_connector_registry import FakeConnectorRegistry
|
|||
from tests.stubs.fake_mcp_registry import FakeMCPRegistry
|
||||
from vibe.core.config import ConnectorConfig, VibeConfig
|
||||
from vibe.core.tools.base import BaseToolConfig, ToolError
|
||||
from vibe.core.tools.connectors import compute_connector_counts
|
||||
from vibe.core.tools.connectors.connector_registry import (
|
||||
ConnectorAuthAction,
|
||||
ConnectorRegistry,
|
||||
|
|
@ -882,3 +883,84 @@ class TestAuthActionablediscovery:
|
|||
assert "linear" in registry.get_connector_names()
|
||||
assert registry.get_auth_action("linear") == ConnectorAuthAction.OAUTH
|
||||
assert registry.get_connector_id("linear") == "c-1"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Banner connector counts
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
class TestComputeConnectorCounts:
|
||||
def test_no_registry(self) -> None:
|
||||
assert compute_connector_counts(build_test_vibe_config(), None) == (0, 0)
|
||||
|
||||
def test_empty_registry(self) -> None:
|
||||
registry = FakeConnectorRegistry()
|
||||
assert compute_connector_counts(build_test_vibe_config(), registry) == (0, 0)
|
||||
|
||||
def test_no_config_entry_is_disabled_by_default(self) -> None:
|
||||
# Mirrors ToolManager: connectors without an explicit ConnectorConfig
|
||||
# entry are disabled (their tools are not registered).
|
||||
registry = FakeConnectorRegistry({
|
||||
"alpha": [RemoteTool(name="search")],
|
||||
"beta": [RemoteTool(name="list")],
|
||||
})
|
||||
assert compute_connector_counts(build_test_vibe_config(), registry) == (0, 2)
|
||||
|
||||
def test_explicitly_enabled_and_connected(self) -> None:
|
||||
registry = FakeConnectorRegistry({
|
||||
"alpha": [RemoteTool(name="search")],
|
||||
"beta": [RemoteTool(name="list")],
|
||||
})
|
||||
config = build_test_vibe_config(
|
||||
connectors=[
|
||||
ConnectorConfig(name="alpha", disabled=False),
|
||||
ConnectorConfig(name="beta", disabled=False),
|
||||
]
|
||||
)
|
||||
assert compute_connector_counts(config, registry) == (2, 2)
|
||||
|
||||
def test_auth_pending_not_counted(self) -> None:
|
||||
# Empty tool list → FakeConnectorRegistry marks as not connected.
|
||||
registry = FakeConnectorRegistry(
|
||||
{"alpha": [RemoteTool(name="search")], "needs_auth": []},
|
||||
auth_actions={"needs_auth": ConnectorAuthAction.OAUTH},
|
||||
)
|
||||
config = build_test_vibe_config(
|
||||
connectors=[
|
||||
ConnectorConfig(name="alpha", disabled=False),
|
||||
ConnectorConfig(name="needs_auth", disabled=False),
|
||||
]
|
||||
)
|
||||
assert compute_connector_counts(config, registry) == (1, 2)
|
||||
|
||||
def test_disabled_not_counted(self) -> None:
|
||||
registry = FakeConnectorRegistry({
|
||||
"alpha": [RemoteTool(name="search")],
|
||||
"beta": [RemoteTool(name="list")],
|
||||
})
|
||||
config = build_test_vibe_config(
|
||||
connectors=[
|
||||
ConnectorConfig(name="alpha", disabled=False),
|
||||
ConnectorConfig(name="beta", disabled=True),
|
||||
]
|
||||
)
|
||||
assert compute_connector_counts(config, registry) == (1, 2)
|
||||
|
||||
def test_disabled_and_pending_combined(self) -> None:
|
||||
registry = FakeConnectorRegistry(
|
||||
{
|
||||
"alpha": [RemoteTool(name="search")],
|
||||
"beta": [RemoteTool(name="list")],
|
||||
"needs_auth": [],
|
||||
},
|
||||
auth_actions={"needs_auth": ConnectorAuthAction.OAUTH},
|
||||
)
|
||||
config = build_test_vibe_config(
|
||||
connectors=[
|
||||
ConnectorConfig(name="alpha", disabled=False),
|
||||
ConnectorConfig(name="beta", disabled=True),
|
||||
ConnectorConfig(name="needs_auth", disabled=False),
|
||||
]
|
||||
)
|
||||
assert compute_connector_counts(config, registry) == (1, 3)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue