Skip to content

Commit a7f2f3c

Browse files
authored
test: GitHub - make tests compatible with new Agent parameters (#2865)
1 parent cec7ccf commit a7f2f3c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

integrations/github/tests/test_file_editor_tool.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,13 @@ def test_pipeline_serialization(self, monkeypatch):
204204
"connections": [],
205205
"connection_type_validation": True,
206206
}
207-
if "confirmation_strategies" in pipeline_dict["components"]["agent"]["init_parameters"]:
208-
expected_dict["components"]["agent"]["init_parameters"]["confirmation_strategies"] = pipeline_dict[
209-
"components"
210-
]["agent"]["init_parameters"]["confirmation_strategies"]
207+
208+
# Compatibility with newer versions of Haystack that include these parameters
209+
for key in ["confirmation_strategies", "required_variables", "user_prompt"]:
210+
if key in pipeline_dict["components"]["agent"]["init_parameters"]:
211+
expected_dict["components"]["agent"]["init_parameters"][key] = pipeline_dict["components"]["agent"][
212+
"init_parameters"
213+
][key]
211214

212215
assert pipeline_dict == expected_dict
213216

0 commit comments

Comments
 (0)