(t *testing.T)
| 322 | } |
| 323 | |
| 324 | func TestHandleGetAttributeNames(t *testing.T) { |
| 325 | server, callAndTestResults := testFrontend() |
| 326 | |
| 327 | tests := []struct { |
| 328 | name string |
| 329 | request mcp.CallToolRequest |
| 330 | expected expectedResult |
| 331 | }{ |
| 332 | { |
| 333 | name: "no scope", |
| 334 | request: callToolRequest(map[string]any{}), |
| 335 | expected: expectedResult{ |
| 336 | path: "/api/v2/search/tags", |
| 337 | params: map[string]string{}, |
| 338 | meta: map[string]any{ |
| 339 | "type": "attribute-names", |
| 340 | "encoding": "json", |
| 341 | "version": "2", |
| 342 | }, |
| 343 | }, |
| 344 | }, |
| 345 | { |
| 346 | name: "with scope", |
| 347 | request: callToolRequest(map[string]any{ |
| 348 | "scope": "span", |
| 349 | }), |
| 350 | expected: expectedResult{ |
| 351 | path: "/api/v2/search/tags", |
| 352 | params: map[string]string{ |
| 353 | "scope": "span", |
| 354 | }, |
| 355 | meta: map[string]any{ |
| 356 | "type": "attribute-names", |
| 357 | "encoding": "json", |
| 358 | "version": "2", |
| 359 | }, |
| 360 | }, |
| 361 | }, |
| 362 | } |
| 363 | |
| 364 | for _, tt := range tests { |
| 365 | t.Run(tt.name, func(t *testing.T) { |
| 366 | callAndTestResults(t, tt.request, server.handleGetAttributeNames, tt.expected) |
| 367 | }) |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | func TestHandleGetAttributeValues(t *testing.T) { |
| 372 | server, callAndTestResults := testFrontend() |
nothing calls this directly
no test coverage detected