(t *testing.T)
| 123 | } |
| 124 | |
| 125 | func TestOpenAPITool_Tools(t *testing.T) { |
| 126 | t.Parallel() |
| 127 | |
| 128 | specServer := serveSpec(t, petStoreSpec) |
| 129 | openAPI := newOpenAPIToolForTest(specServer.URL+"/openapi.json", nil) |
| 130 | |
| 131 | toolsList, err := openAPI.Tools(t.Context()) |
| 132 | require.NoError(t, err) |
| 133 | assert.Len(t, toolsList, 3) |
| 134 | |
| 135 | listPets := toolByName(t, toolsList, "listPets") |
| 136 | assert.Equal(t, "List all pets", listPets.Description) |
| 137 | assert.Equal(t, "openapi", listPets.Category) |
| 138 | assert.True(t, listPets.Annotations.ReadOnlyHint) |
| 139 | |
| 140 | createPet := toolByName(t, toolsList, "createPet") |
| 141 | assert.Equal(t, "Create a pet", createPet.Description) |
| 142 | assert.False(t, createPet.Annotations.ReadOnlyHint) |
| 143 | |
| 144 | showPet := toolByName(t, toolsList, "showPetById") |
| 145 | assert.Equal(t, "Info for a specific pet", showPet.Description) |
| 146 | } |
| 147 | |
| 148 | func TestOpenAPITool_ToolParameters(t *testing.T) { |
| 149 | t.Parallel() |
nothing calls this directly
no test coverage detected