From 2e0d590d802015a931b4b7254e000df543d08859 Mon Sep 17 00:00:00 2001 From: LuLu Zuo Date: Mon, 23 Oct 2023 12:01:53 +0800 Subject: [PATCH] add some assert --- .../executor/e2etests/test_executor_happypath.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/promptflow/tests/executor/e2etests/test_executor_happypath.py b/src/promptflow/tests/executor/e2etests/test_executor_happypath.py index fc4f39228ad..251a60853d4 100644 --- a/src/promptflow/tests/executor/e2etests/test_executor_happypath.py +++ b/src/promptflow/tests/executor/e2etests/test_executor_happypath.py @@ -280,7 +280,17 @@ def test_executor_exec_with_image_node(self, flow_folder, node_name, flow_inputs output_relative_path_dir=("./temp"), raise_ex=True, ) - assert "data:image/jpg;path" and "temp" in str(run_info.output) + + def assert_contains_substrings(s, substrings): + for substring in substrings: + assert substring in s + + substrings = ["data:image/jpg;path", "temp", "jpg"] + + assert_contains_substrings(str(run_info.inputs), substrings) + assert_contains_substrings(str(run_info.output), substrings) + assert_contains_substrings(str(run_info.result), substrings) + assert_contains_substrings(str(run_info.api_calls[0]), substrings) assert run_info.status == Status.Completed assert isinstance(run_info.api_calls, list) assert run_info.node == node_name