mirror of
https://github.com/langgenius/dify.git
synced 2026-05-20 16:57:01 +08:00
- Remove response_mode from AppRunRequest; openapi /run always streams - Add POST /apps/<id>/tasks/<task_id>/stop (SIGINT hook target) - Add GET/POST /apps/<id>/form/human_input/<token> (HITL form fetch/submit) - Add GET /apps/<id>/tasks/<task_id>/events (SSE reconnect after resume) - Add HumanInputSurface.OPENAPI; map to STANDALONE_WEB_APP recipient type - Regenerate cli/src/types/data-contracts.ts via pnpm sync-models
33 lines
816 B
Python
33 lines
816 B
Python
import pytest
|
|
from flask import Flask
|
|
|
|
from controllers.openapi import bp as openapi_bp
|
|
from controllers.openapi.auth.pipeline import Pipeline
|
|
|
|
|
|
@pytest.fixture
|
|
def bypass_pipeline(monkeypatch):
|
|
"""Stub Pipeline.run so endpoint decoration does not invoke real auth.
|
|
|
|
Module-level @OAUTH_BEARER_PIPELINE.guard(...) captures the real
|
|
pipeline at import time; mocking the module attribute does not undo
|
|
that. Patching Pipeline.run on the class is the bypass that actually
|
|
works.
|
|
"""
|
|
monkeypatch.setattr(Pipeline, "run", lambda self, ctx: None)
|
|
|
|
|
|
@pytest.fixture
|
|
def openapi_app():
|
|
app = Flask(__name__)
|
|
app.config["TESTING"] = True
|
|
app.register_blueprint(openapi_bp)
|
|
return app
|
|
|
|
|
|
@pytest.fixture
|
|
def app():
|
|
a = Flask(__name__)
|
|
a.config["TESTING"] = True
|
|
return a
|