Skip to content

Commit 54b166f

Browse files
authored
Fix tool validation test failures (#2659)
1 parent 454d9ee commit 54b166f

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

integrations/github/tests/test_file_editor_tool.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def test_to_dict_with_extra_params(self, monkeypatch):
7777
tool = GitHubFileEditorTool(
7878
outputs_to_string={"source": "result", "handler": message_handler},
7979
inputs_from_state={"repo_state": "repo"},
80-
outputs_to_state={"file_content": {"source": "content", "handler": message_handler}},
80+
outputs_to_state={"file_content": {"source": "result", "handler": message_handler}},
8181
)
8282

8383
tool_dict = tool.to_dict()
@@ -88,7 +88,7 @@ def test_to_dict_with_extra_params(self, monkeypatch):
8888
assert tool_dict["data"]["inputs_from_state"] == {"repo_state": "repo"}
8989
assert tool_dict["data"]["outputs_to_state"] == {
9090
"file_content": {
91-
"source": "content",
91+
"source": "result",
9292
"handler": "haystack_integrations.tools.github.utils.message_handler",
9393
},
9494
}
@@ -113,7 +113,7 @@ def test_from_dict_with_extra_params(self, monkeypatch):
113113
"inputs_from_state": {"repo_state": "repo"},
114114
"outputs_to_state": {
115115
"file_content": {
116-
"source": "content",
116+
"source": "result",
117117
"handler": "haystack_integrations.tools.github.utils.message_handler",
118118
},
119119
},
@@ -124,7 +124,7 @@ def test_from_dict_with_extra_params(self, monkeypatch):
124124
assert tool.outputs_to_string["source"] == "result"
125125
assert tool.outputs_to_string["handler"] == message_handler
126126
assert tool.inputs_from_state == {"repo_state": "repo"}
127-
assert tool.outputs_to_state["file_content"]["source"] == "content"
127+
assert tool.outputs_to_state["file_content"]["source"] == "result"
128128
assert tool.outputs_to_state["file_content"]["handler"] == message_handler
129129

130130
def test_pipeline_serialization(self, monkeypatch):

integrations/github/tests/test_issue_commenter_tool.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def test_to_dict_with_extra_params(self, monkeypatch):
7777
retry_attempts=3,
7878
outputs_to_string={"handler": message_handler},
7979
inputs_from_state={"repository": "repo"},
80-
outputs_to_state={"documents": {"source": "docs", "handler": message_handler}},
80+
outputs_to_state={"documents": {"source": "success", "handler": message_handler}},
8181
)
8282
tool_dict = tool.to_dict()
8383
assert tool_dict["type"] == "haystack_integrations.tools.github.issue_commenter_tool.GitHubIssueCommenterTool"
@@ -92,7 +92,7 @@ def test_to_dict_with_extra_params(self, monkeypatch):
9292
== "haystack_integrations.tools.github.utils.message_handler"
9393
)
9494
assert tool_dict["data"]["inputs_from_state"] == {"repository": "repo"}
95-
assert tool_dict["data"]["outputs_to_state"]["documents"]["source"] == "docs"
95+
assert tool_dict["data"]["outputs_to_state"]["documents"]["source"] == "success"
9696
assert (
9797
tool_dict["data"]["outputs_to_state"]["documents"]["handler"]
9898
== "haystack_integrations.tools.github.utils.message_handler"
@@ -113,7 +113,7 @@ def test_from_dict_with_extra_params(self, monkeypatch):
113113
"inputs_from_state": {"repository": "repo"},
114114
"outputs_to_state": {
115115
"documents": {
116-
"source": "docs",
116+
"source": "success",
117117
"handler": "haystack_integrations.tools.github.utils.message_handler",
118118
}
119119
},
@@ -128,5 +128,5 @@ def test_from_dict_with_extra_params(self, monkeypatch):
128128
assert tool.retry_attempts == 3
129129
assert tool.outputs_to_string["handler"] == message_handler
130130
assert tool.inputs_from_state == {"repository": "repo"}
131-
assert tool.outputs_to_state["documents"]["source"] == "docs"
131+
assert tool.outputs_to_state["documents"]["source"] == "success"
132132
assert tool.outputs_to_state["documents"]["handler"] == message_handler

integrations/github/tests/test_issue_viewer_tool.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_to_dict_with_extra_params(self, monkeypatch):
7373
retry_attempts=3,
7474
outputs_to_string={"handler": message_handler},
7575
inputs_from_state={"repository": "repo"},
76-
outputs_to_state={"documents": {"source": "docs", "handler": message_handler}},
76+
outputs_to_state={"documents": {"source": "documents", "handler": message_handler}},
7777
)
7878
tool_dict = tool.to_dict()
7979
assert tool_dict["type"] == "haystack_integrations.tools.github.issue_viewer_tool.GitHubIssueViewerTool"
@@ -88,7 +88,7 @@ def test_to_dict_with_extra_params(self, monkeypatch):
8888
== "haystack_integrations.tools.github.utils.message_handler"
8989
)
9090
assert tool_dict["data"]["inputs_from_state"] == {"repository": "repo"}
91-
assert tool_dict["data"]["outputs_to_state"]["documents"]["source"] == "docs"
91+
assert tool_dict["data"]["outputs_to_state"]["documents"]["source"] == "documents"
9292
assert (
9393
tool_dict["data"]["outputs_to_state"]["documents"]["handler"]
9494
== "haystack_integrations.tools.github.utils.message_handler"
@@ -109,7 +109,7 @@ def test_from_dict_with_extra_params(self, monkeypatch):
109109
"inputs_from_state": {"repository": "repo"},
110110
"outputs_to_state": {
111111
"documents": {
112-
"source": "docs",
112+
"source": "documents",
113113
"handler": "haystack_integrations.tools.github.utils.message_handler",
114114
}
115115
},
@@ -124,5 +124,5 @@ def test_from_dict_with_extra_params(self, monkeypatch):
124124
assert tool.retry_attempts == 3
125125
assert tool.outputs_to_string["handler"] == message_handler
126126
assert tool.inputs_from_state == {"repository": "repo"}
127-
assert tool.outputs_to_state["documents"]["source"] == "docs"
127+
assert tool.outputs_to_state["documents"]["source"] == "documents"
128128
assert tool.outputs_to_state["documents"]["handler"] == message_handler

integrations/github/tests/test_pr_creator_tool.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_to_dict_with_extra_params(self, monkeypatch):
7474
raise_on_failure=False,
7575
outputs_to_string={"handler": message_handler},
7676
inputs_from_state={"repository": "repo"},
77-
outputs_to_state={"documents": {"source": "docs", "handler": message_handler}},
77+
outputs_to_state={"documents": {"source": "result", "handler": message_handler}},
7878
)
7979
tool_dict = tool.to_dict()
8080
assert tool_dict["type"] == "haystack_integrations.tools.github.pr_creator_tool.GitHubPRCreatorTool"
@@ -92,7 +92,7 @@ def test_to_dict_with_extra_params(self, monkeypatch):
9292
== "haystack_integrations.tools.github.utils.message_handler"
9393
)
9494
assert tool_dict["data"]["inputs_from_state"] == {"repository": "repo"}
95-
assert tool_dict["data"]["outputs_to_state"]["documents"]["source"] == "docs"
95+
assert tool_dict["data"]["outputs_to_state"]["documents"]["source"] == "result"
9696
assert (
9797
tool_dict["data"]["outputs_to_state"]["documents"]["handler"]
9898
== "haystack_integrations.tools.github.utils.message_handler"
@@ -112,7 +112,7 @@ def test_from_dict_with_extra_params(self, monkeypatch):
112112
"inputs_from_state": {"repository": "repo"},
113113
"outputs_to_state": {
114114
"documents": {
115-
"source": "docs",
115+
"source": "result",
116116
"handler": "haystack_integrations.tools.github.utils.message_handler",
117117
}
118118
},
@@ -126,5 +126,5 @@ def test_from_dict_with_extra_params(self, monkeypatch):
126126
assert tool.raise_on_failure is False
127127
assert tool.outputs_to_string["handler"] == message_handler
128128
assert tool.inputs_from_state == {"repository": "repo"}
129-
assert tool.outputs_to_state["documents"]["source"] == "docs"
129+
assert tool.outputs_to_state["documents"]["source"] == "result"
130130
assert tool.outputs_to_state["documents"]["handler"] == message_handler

integrations/github/tests/test_repo_forker_tool.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ def test_to_dict_with_extra_params(self, monkeypatch):
7070
tool = GitHubRepoForkerTool(
7171
github_token=Secret.from_env_var("GITHUB_TOKEN"),
7272
raise_on_failure=False,
73-
outputs_to_string={"source": "docs", "handler": message_handler},
73+
outputs_to_string={"source": "repo", "handler": message_handler},
7474
inputs_from_state={"repository": "repo"},
75-
outputs_to_state={"documents": {"source": "docs", "handler": message_handler}},
75+
outputs_to_state={"documents": {"source": "repo", "handler": message_handler}},
7676
)
7777
tool_dict = tool.to_dict()
7878
assert tool_dict["type"] == "haystack_integrations.tools.github.repo_forker_tool.GitHubRepoForkerTool"
@@ -90,7 +90,7 @@ def test_to_dict_with_extra_params(self, monkeypatch):
9090
== "haystack_integrations.tools.github.utils.message_handler"
9191
)
9292
assert tool_dict["data"]["inputs_from_state"] == {"repository": "repo"}
93-
assert tool_dict["data"]["outputs_to_state"]["documents"]["source"] == "docs"
93+
assert tool_dict["data"]["outputs_to_state"]["documents"]["source"] == "repo"
9494
assert (
9595
tool_dict["data"]["outputs_to_state"]["documents"]["handler"]
9696
== "haystack_integrations.tools.github.utils.message_handler"
@@ -110,7 +110,7 @@ def test_from_dict_with_extra_params(self, monkeypatch):
110110
"inputs_from_state": {"repository": "repo"},
111111
"outputs_to_state": {
112112
"documents": {
113-
"source": "docs",
113+
"source": "repo",
114114
"handler": "haystack_integrations.tools.github.utils.message_handler",
115115
}
116116
},
@@ -124,5 +124,5 @@ def test_from_dict_with_extra_params(self, monkeypatch):
124124
assert tool.raise_on_failure is False
125125
assert tool.outputs_to_string["handler"] == message_handler
126126
assert tool.inputs_from_state == {"repository": "repo"}
127-
assert tool.outputs_to_state["documents"]["source"] == "docs"
127+
assert tool.outputs_to_state["documents"]["source"] == "repo"
128128
assert tool.outputs_to_state["documents"]["handler"] == message_handler

integrations/github/tests/test_repo_viewer_tool.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_to_dict_with_extra_params(self, monkeypatch):
8383
tool = GitHubRepoViewerTool(
8484
outputs_to_string={"source": "result", "handler": message_handler},
8585
inputs_from_state={"repo_state": "repo"},
86-
outputs_to_state={"file_content": {"source": "content", "handler": message_handler}},
86+
outputs_to_state={"file_content": {"source": "documents", "handler": message_handler}},
8787
)
8888

8989
tool_dict = tool.to_dict()
@@ -94,7 +94,7 @@ def test_to_dict_with_extra_params(self, monkeypatch):
9494
assert tool_dict["data"]["inputs_from_state"] == {"repo_state": "repo"}
9595
assert tool_dict["data"]["outputs_to_state"] == {
9696
"file_content": {
97-
"source": "content",
97+
"source": "documents",
9898
"handler": "haystack_integrations.tools.github.utils.message_handler",
9999
},
100100
}
@@ -120,7 +120,7 @@ def test_from_dict_with_extra_params(self, monkeypatch):
120120
"inputs_from_state": {"repo_state": "repo"},
121121
"outputs_to_state": {
122122
"file_content": {
123-
"source": "content",
123+
"source": "documents",
124124
"handler": "haystack_integrations.tools.github.utils.message_handler",
125125
},
126126
},
@@ -131,5 +131,5 @@ def test_from_dict_with_extra_params(self, monkeypatch):
131131
assert tool.outputs_to_string["source"] == "result"
132132
assert tool.outputs_to_string["handler"] == message_handler
133133
assert tool.inputs_from_state == {"repo_state": "repo"}
134-
assert tool.outputs_to_state["file_content"]["source"] == "content"
134+
assert tool.outputs_to_state["file_content"]["source"] == "documents"
135135
assert tool.outputs_to_state["file_content"]["handler"] == message_handler

0 commit comments

Comments
 (0)