mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-15 09:28:27 +08:00
@@ -71,8 +71,11 @@ def _load_agent_api(monkeypatch, *, storage_get):
|
||||
_stub(
|
||||
monkeypatch,
|
||||
"api.apps",
|
||||
AUTH_JWT="jwt",
|
||||
AUTH_API="api",
|
||||
AUTH_BETA="beta",
|
||||
current_user=SimpleNamespace(id="tenant-1"),
|
||||
login_required=lambda func: func,
|
||||
login_required=lambda func=None, **_kwargs: (lambda f: f) if func is None else func,
|
||||
)
|
||||
_stub(monkeypatch, "api.apps.services.canvas_replica_service", CanvasReplicaService=SimpleNamespace())
|
||||
_stub(monkeypatch, "api.db", CanvasCategory=SimpleNamespace())
|
||||
|
||||
@@ -44,7 +44,16 @@ def _load_agent_api(monkeypatch, get_by_id_result, delete_calls=None):
|
||||
delete_calls.append(session_id)
|
||||
return True
|
||||
|
||||
_stub(monkeypatch, "api.apps", current_user=SimpleNamespace(id="tenant-1"), login_required=lambda func: func)
|
||||
_stub(
|
||||
monkeypatch,
|
||||
"api.apps",
|
||||
AUTH_JWT="jwt",
|
||||
AUTH_API="api",
|
||||
AUTH_BETA="beta",
|
||||
QuartAuthUnauthorized=Exception,
|
||||
current_user=SimpleNamespace(id="tenant-1", is_superuser=True),
|
||||
login_required=lambda func=None, **_kwargs: (lambda f: f) if func is None else func,
|
||||
)
|
||||
_stub(monkeypatch, "api.apps.services.canvas_replica_service", CanvasReplicaService=SimpleNamespace())
|
||||
_stub(monkeypatch, "api.db", CanvasCategory=SimpleNamespace())
|
||||
_stub(monkeypatch, "api.db.db_models", Task=SimpleNamespace())
|
||||
|
||||
@@ -48,7 +48,16 @@ def _load_agent_api_for_rerun(monkeypatch, *, documents_info, accessible):
|
||||
|
||||
acc_fn = accessible if callable(accessible) else (lambda *_a, **_k: accessible)
|
||||
|
||||
_stub(monkeypatch, "api.apps", current_user=SimpleNamespace(id="user-owner"), login_required=lambda func: func)
|
||||
_stub(
|
||||
monkeypatch,
|
||||
"api.apps",
|
||||
AUTH_JWT="jwt",
|
||||
AUTH_API="api",
|
||||
AUTH_BETA="beta",
|
||||
QuartAuthUnauthorized=Exception,
|
||||
current_user=SimpleNamespace(id="user-owner", is_superuser=True),
|
||||
login_required=lambda func=None, **_kwargs: (lambda f: f) if func is None else func,
|
||||
)
|
||||
_stub(monkeypatch, "api.apps.services.canvas_replica_service", CanvasReplicaService=SimpleNamespace())
|
||||
_stub(monkeypatch, "api.db", CanvasCategory=SimpleNamespace())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user