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 @@ -428,6 +428,32 @@ async def test_get_issue(jira_client, mock_jira_fetcher):
428428 )
429429
430430
431+ @pytest .mark .anyio
432+ async def test_get_issue_invalid_key (jira_client , mock_jira_fetcher ):
433+ """Test that get_issue fails when a key does not exist and provides an informative error."""
434+ mock_jira_fetcher .get_issue .side_effect = ValueError ("Issue Does Not Exist" )
435+
436+ with pytest .raises (ToolError ) as excinfo :
437+ await jira_client .call_tool (
438+ "jira_get_issue" ,
439+ {
440+ "issue_key" : "FAIL-123" ,
441+ "fields" : "summary,description,status" ,
442+ },
443+ )
444+
445+ mock_jira_fetcher .get_issue .assert_called_once_with (
446+ issue_key = "FAIL-123" ,
447+ fields = ["summary" , "description" , "status" ],
448+ expand = None ,
449+ comment_limit = 10 ,
450+ properties = None ,
451+ update_history = True ,
452+ )
453+
454+ assert "Error calling tool 'get_issue': Issue Does Not Exist" in str (excinfo .value )
455+
456+
431457@pytest .mark .anyio
432458async def test_search (jira_client , mock_jira_fetcher ):
433459 """Test the search tool with fixture data."""
You can’t perform that action at this time.
0 commit comments