(t *testing.T)
| 206 | } |
| 207 | |
| 208 | func Test_GetTeams(t *testing.T) { |
| 209 | t.Parallel() |
| 210 | |
| 211 | serverTool := GetTeams(translations.NullTranslationHelper) |
| 212 | tool := serverTool.Tool |
| 213 | require.NoError(t, toolsnaps.Test(tool.Name, tool)) |
| 214 | |
| 215 | assert.Equal(t, "get_teams", tool.Name) |
| 216 | assert.True(t, tool.Annotations.ReadOnlyHint, "get_teams tool should be read-only") |
| 217 | |
| 218 | mockUser := &github.User{ |
| 219 | Login: github.Ptr("testuser"), |
| 220 | Name: github.Ptr("Test User"), |
| 221 | Email: github.Ptr("test@example.com"), |
| 222 | Bio: github.Ptr("GitHub user for testing"), |
| 223 | Company: github.Ptr("Test Company"), |
| 224 | Location: github.Ptr("Test Location"), |
| 225 | HTMLURL: github.Ptr("https://github.com/testuser"), |
| 226 | CreatedAt: &github.Timestamp{Time: time.Now().Add(-365 * 24 * time.Hour)}, |
| 227 | Type: github.Ptr("User"), |
| 228 | Hireable: github.Ptr(true), |
| 229 | TwitterUsername: github.Ptr("testuser_twitter"), |
| 230 | Plan: &github.Plan{ |
| 231 | Name: github.Ptr("pro"), |
| 232 | }, |
| 233 | } |
| 234 | |
| 235 | mockTeamsResponse := githubv4mock.DataResponse(map[string]any{ |
| 236 | "user": map[string]any{ |
| 237 | "organizations": map[string]any{ |
| 238 | "nodes": []map[string]any{ |
| 239 | { |
| 240 | "login": "testorg1", |
| 241 | "teams": map[string]any{ |
| 242 | "nodes": []map[string]any{ |
| 243 | { |
| 244 | "name": "team1", |
| 245 | "slug": "team1", |
| 246 | "description": "Team 1", |
| 247 | }, |
| 248 | { |
| 249 | "name": "team2", |
| 250 | "slug": "team2", |
| 251 | "description": "Team 2", |
| 252 | }, |
| 253 | }, |
| 254 | }, |
| 255 | }, |
| 256 | { |
| 257 | "login": "testorg2", |
| 258 | "teams": map[string]any{ |
| 259 | "nodes": []map[string]any{ |
| 260 | { |
| 261 | "name": "team3", |
| 262 | "slug": "team3", |
| 263 | "description": "Team 3", |
| 264 | }, |
| 265 | }, |
nothing calls this directly
no test coverage detected