Skip to content

Commit f53dea2

Browse files
committed
Add nil check for tool.Annotations and rename Test_CreateIssue to Test_IssueWrite_Create
Addresses Copilot feedback on #2470. The test exercises IssueWrite, so its name now matches the tool under test.
1 parent 9d798a0 commit f53dea2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

pkg/github/issues_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,14 +1050,15 @@ func unmarshalIFC(t *testing.T, ifcLabel any) map[string]any {
10501050
return ifcMap
10511051
}
10521052

1053-
func Test_CreateIssue(t *testing.T) {
1053+
func Test_IssueWrite_Create(t *testing.T) {
10541054
// Verify tool definition once
10551055
serverTool := IssueWrite(translations.NullTranslationHelper)
10561056
tool := serverTool.Tool
10571057
require.NoError(t, toolsnaps.Test(tool.Name, tool))
10581058

10591059
assert.Equal(t, "issue_write", tool.Name)
10601060
assert.NotEmpty(t, tool.Description)
1061+
require.NotNil(t, tool.Annotations)
10611062
require.NotNil(t, tool.Annotations.DestructiveHint)
10621063
assert.True(t, *tool.Annotations.DestructiveHint)
10631064
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "method")

0 commit comments

Comments
 (0)