Skip to content

Commit 7ee1d3c

Browse files
committed
Add tests for tool icon endpoint handling simple and toolshed tool IDs
1 parent 8217fd1 commit 7ee1d3c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/galaxy_test/api/test_tools.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,20 @@ def test_show_output_collection(self):
257257
assert output["label"] == "Duplicate List"
258258
assert output["inherit_format"] is True
259259

260+
def test_tool_icon_endpoint_with_simple_id(self):
261+
response = self._get("tools/simple_tool_id/icon")
262+
self._assert_status_code_is(response, 404)
263+
264+
def test_tool_icon_endpoint_with_toolshed_id(self):
265+
# Test complex toolshed tool ID with slashes
266+
toolshed_tool_id = "toolshed.g2.bx.psu.edu/repos/devteam/fastqc/fastqc/0.74+galaxy0"
267+
response = self._get(f"tools/{toolshed_tool_id}/icon")
268+
# We expect either 200 (if tool is installed and has icon) or 404 (if
269+
# not found), but this tests the routing either way.
270+
assert response.status_code in [200, 404]
271+
if response.status_code == 200:
272+
assert response.headers["Content-Type"] == "image/png"
273+
260274
@skip_without_tool("test_data_source")
261275
def test_data_source_build_request(self):
262276
with self.dataset_populator.test_history() as history_id:

0 commit comments

Comments
 (0)