mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-13 14:15:52 +00:00
A connector's enabled switch is now optional: unset means on when the connector has the server settings it needs, so Google Drive, SharePoint and Confluence start off until their OAuth settings are present, and an admin's explicit switch always wins. Changing only the sharing mode no longer switches a connector on. Members only see connectors they can use. The catalog, Add Source tiles and Add Tool leave out anything turned off or still needing setup, except a connector a member already has a connection to, which stays listed as turned off so it can be managed or removed.
25 lines
786 B
Python
25 lines
786 B
Python
"""Shared fixtures for connector tests."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def _oauth_connectors_configured(monkeypatch):
|
|
"""Give the OAuth connectors their server settings.
|
|
|
|
A connector without them is off and hidden from members, so tests about
|
|
anything else start from configured connectors. A test about setup sets
|
|
a setting back to None itself.
|
|
"""
|
|
from docsgpt.core.settings import settings
|
|
|
|
for name in (
|
|
"GOOGLE_CLIENT_ID", "GOOGLE_CLIENT_SECRET",
|
|
"MICROSOFT_CLIENT_ID", "MICROSOFT_CLIENT_SECRET",
|
|
"CONFLUENCE_CLIENT_ID", "CONFLUENCE_CLIENT_SECRET",
|
|
):
|
|
if not getattr(settings, name, None):
|
|
monkeypatch.setattr(settings, name, f"test-{name.lower()}")
|