瀏覽代碼

test(graph-engine-test): modify the assert condition (#19041)

tags/1.4.0
Novice 6 月之前
父節點
當前提交
e36b1a7016
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 4 行新增3 行删除
  1. 4
    3
      api/tests/unit_tests/core/workflow/graph_engine/test_graph_engine.py

+ 4
- 3
api/tests/unit_tests/core/workflow/graph_engine/test_graph_engine.py 查看文件

@@ -864,10 +864,11 @@ def test_condition_parallel_correct_output(mock_close, mock_remove, app):
with patch.object(CodeNode, "_run", new=code_generator):
generator = graph_engine.run()
stream_content = ""
res_content = "VAT:\ndify 123"
wrong_content = ["Stamp Duty", "other"]
for item in generator:
if isinstance(item, NodeRunStreamChunkEvent):
stream_content += f"{item.chunk_content}\n"
if isinstance(item, GraphRunSucceededEvent):
assert item.outputs == {"answer": res_content}
assert stream_content == res_content + "\n"
assert item.outputs is not None
answer = item.outputs["answer"]
assert all(rc not in answer for rc in wrong_content)

Loading…
取消
儲存