mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-05-16 02:28:18 +08:00
test(graph-engine-test): modify the assert condition (#19041)
This commit is contained in:
parent
bf46b894e9
commit
e36b1a7016
@ -864,10 +864,11 @@ def test_condition_parallel_correct_output(mock_close, mock_remove, app):
|
|||||||
with patch.object(CodeNode, "_run", new=code_generator):
|
with patch.object(CodeNode, "_run", new=code_generator):
|
||||||
generator = graph_engine.run()
|
generator = graph_engine.run()
|
||||||
stream_content = ""
|
stream_content = ""
|
||||||
res_content = "VAT:\ndify 123"
|
wrong_content = ["Stamp Duty", "other"]
|
||||||
for item in generator:
|
for item in generator:
|
||||||
if isinstance(item, NodeRunStreamChunkEvent):
|
if isinstance(item, NodeRunStreamChunkEvent):
|
||||||
stream_content += f"{item.chunk_content}\n"
|
stream_content += f"{item.chunk_content}\n"
|
||||||
if isinstance(item, GraphRunSucceededEvent):
|
if isinstance(item, GraphRunSucceededEvent):
|
||||||
assert item.outputs == {"answer": res_content}
|
assert item.outputs is not None
|
||||||
assert stream_content == res_content + "\n"
|
answer = item.outputs["answer"]
|
||||||
|
assert all(rc not in answer for rc in wrong_content)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user