File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -427,6 +427,32 @@ async def test_get_issue(jira_client, mock_jira_fetcher):
427427 update_history = True ,
428428 )
429429
430+ @pytest .mark .anyio
431+ async def test_get_issue_invalid_key (jira_client , mock_jira_fetcher ):
432+ """Test that get_issue fails when a key does not exist and provides an informative error."""
433+ mock_jira_fetcher .get_issue .side_effect = ValueError (
434+ "Issue Does Not Exist"
435+ )
436+
437+ with pytest .raises (ToolError ) as excinfo :
438+ await jira_client .call_tool (
439+ "jira_get_issue" ,
440+ {
441+ "issue_key" : "FAIL-123" ,
442+ "fields" : "summary,description,status" ,
443+ },
444+ )
445+
446+ mock_jira_fetcher .get_issue .assert_called_once_with (
447+ issue_key = "FAIL-123" ,
448+ fields = ["summary" , "description" , "status" ],
449+ expand = None ,
450+ comment_limit = 10 ,
451+ properties = None ,
452+ update_history = True ,
453+ )
454+
455+ assert "Error calling tool 'get_issue': Issue Does Not Exist" in str (excinfo .value )
430456
431457@pytest .mark .anyio
432458async def test_search (jira_client , mock_jira_fetcher ):
You can’t perform that action at this time.
0 commit comments