mirror of
https://github.com/langgenius/dify.git
synced 2026-07-19 16:44:00 -04:00
test(advanced_chat): supply new WorkflowSnapshot fields at direct construction sites
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -401,7 +401,14 @@ class TestAdvancedChatAppGeneratorInternals:
|
||||
workflow_run_id="run-id",
|
||||
)
|
||||
|
||||
workflow = SimpleNamespace(id="wf-1", tenant_id="tenant", features={"feature": True}, features_dict={})
|
||||
workflow = SimpleNamespace(
|
||||
id="wf-1",
|
||||
tenant_id="tenant",
|
||||
features={"feature": True},
|
||||
features_dict={},
|
||||
environment_variables=[],
|
||||
conversation_variables=[],
|
||||
)
|
||||
conversation = SimpleNamespace(id="conv-1", mode=AppMode.ADVANCED_CHAT, override_model_configs=None)
|
||||
message = SimpleNamespace(
|
||||
id="msg-1",
|
||||
@@ -506,7 +513,14 @@ class TestAdvancedChatAppGeneratorInternals:
|
||||
workflow_run_id="run-id",
|
||||
)
|
||||
|
||||
workflow = SimpleNamespace(id="wf-2", tenant_id="tenant", features={}, features_dict={})
|
||||
workflow = SimpleNamespace(
|
||||
id="wf-2",
|
||||
tenant_id="tenant",
|
||||
features={},
|
||||
features_dict={},
|
||||
environment_variables=[],
|
||||
conversation_variables=[],
|
||||
)
|
||||
conversation = SimpleNamespace(id="conv-2", mode=AppMode.ADVANCED_CHAT, override_model_configs=None)
|
||||
message = SimpleNamespace(
|
||||
id="msg-2",
|
||||
@@ -981,7 +995,13 @@ class TestAdvancedChatAppGeneratorInternals:
|
||||
with pytest.raises(GenerateTaskStoppedError):
|
||||
generator._handle_advanced_chat_response(
|
||||
application_generate_entity=application_generate_entity,
|
||||
workflow=WorkflowSnapshot(id="wf", tenant_id="tenant", features_dict={}),
|
||||
workflow=WorkflowSnapshot(
|
||||
id="wf",
|
||||
tenant_id="tenant",
|
||||
features_dict={},
|
||||
environment_variables=(),
|
||||
conversation_variables=(),
|
||||
),
|
||||
queue_manager=SimpleNamespace(),
|
||||
conversation=ConversationSnapshot(id="conv", mode=AppMode.ADVANCED_CHAT),
|
||||
message=MessageSnapshot(
|
||||
@@ -1029,7 +1049,13 @@ class TestAdvancedChatAppGeneratorInternals:
|
||||
with pytest.raises(ValueError, match="other error"):
|
||||
generator._handle_advanced_chat_response(
|
||||
application_generate_entity=application_generate_entity,
|
||||
workflow=WorkflowSnapshot(id="wf", tenant_id="tenant", features_dict={}),
|
||||
workflow=WorkflowSnapshot(
|
||||
id="wf",
|
||||
tenant_id="tenant",
|
||||
features_dict={},
|
||||
environment_variables=(),
|
||||
conversation_variables=(),
|
||||
),
|
||||
queue_manager=SimpleNamespace(),
|
||||
conversation=ConversationSnapshot(id="conv", mode=AppMode.ADVANCED_CHAT),
|
||||
message=MessageSnapshot(
|
||||
|
||||
@@ -170,7 +170,13 @@ def test_resume_appends_chunks_to_paused_answer() -> None:
|
||||
user = EndUser()
|
||||
user.id = "user-1"
|
||||
user.session_id = "session-1"
|
||||
workflow = pipeline_module.WorkflowSnapshot(id="workflow-1", tenant_id="tenant-1", features_dict={})
|
||||
workflow = pipeline_module.WorkflowSnapshot(
|
||||
id="workflow-1",
|
||||
tenant_id="tenant-1",
|
||||
features_dict={},
|
||||
environment_variables=(),
|
||||
conversation_variables=(),
|
||||
)
|
||||
|
||||
pipeline = pipeline_module.AdvancedChatAppGenerateTaskPipeline(
|
||||
application_generate_entity=application_generate_entity,
|
||||
|
||||
+7
-1
@@ -92,7 +92,13 @@ def _make_pipeline():
|
||||
answer="",
|
||||
)
|
||||
conversation = ConversationSnapshot(id="conv-id", mode=AppMode.ADVANCED_CHAT)
|
||||
workflow = WorkflowSnapshot(id="workflow-id", tenant_id="tenant", features_dict={})
|
||||
workflow = WorkflowSnapshot(
|
||||
id="workflow-id",
|
||||
tenant_id="tenant",
|
||||
features_dict={},
|
||||
environment_variables=(),
|
||||
conversation_variables=(),
|
||||
)
|
||||
user = EndUser(tenant_id="tenant", type="session", name="tester", session_id="session")
|
||||
|
||||
pipeline = AdvancedChatAppGenerateTaskPipeline(
|
||||
|
||||
Reference in New Issue
Block a user