MCPcopy Index your code
hub / github.com/cli/cli / Test_RepoMetadata

Function Test_RepoMetadata

api/queries_repo_test.go:206–382  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

204}
205
206func Test_RepoMetadata(t *testing.T) {
207 http := &httpmock.Registry{}
208 client := newTestClient(http)
209
210 repo, _ := ghrepo.FromFullName("OWNER/REPO")
211 input := RepoMetadataInput{
212 Assignees: true,
213 Reviewers: true,
214 TeamReviewers: true,
215 Labels: true,
216 ProjectsV1: true,
217 ProjectsV2: true,
218 Milestones: true,
219 }
220
221 http.Register(
222 httpmock.GraphQL(`query RepositoryAssignableUsers\b`),
223 httpmock.StringResponse(`
224 { "data": { "repository": { "assignableUsers": {
225 "nodes": [
226 { "login": "hubot", "id": "HUBOTID" },
227 { "login": "MonaLisa", "id": "MONAID" }
228 ],
229 "pageInfo": { "hasNextPage": false }
230 } } } }
231 `))
232 http.Register(
233 httpmock.GraphQL(`query RepositoryLabelList\b`),
234 httpmock.StringResponse(`
235 { "data": { "repository": { "labels": {
236 "nodes": [
237 { "name": "feature", "id": "FEATUREID" },
238 { "name": "TODO", "id": "TODOID" },
239 { "name": "bug", "id": "BUGID" }
240 ],
241 "pageInfo": { "hasNextPage": false }
242 } } } }
243 `))
244 http.Register(
245 httpmock.GraphQL(`query RepositoryMilestoneList\b`),
246 httpmock.StringResponse(`
247 { "data": { "repository": { "milestones": {
248 "nodes": [
249 { "title": "GA", "id": "GAID" },
250 { "title": "Big One.oh", "id": "BIGONEID" }
251 ],
252 "pageInfo": { "hasNextPage": false }
253 } } } }
254 `))
255 http.Register(
256 httpmock.GraphQL(`query RepositoryProjectList\b`),
257 httpmock.StringResponse(`
258 { "data": { "repository": { "projects": {
259 "nodes": [
260 { "name": "Cleanup", "id": "CLEANUPID" },
261 { "name": "Roadmap", "id": "ROADMAPID" }
262 ],
263 "pageInfo": { "hasNextPage": false }

Callers

nothing calls this directly

Calls 13

RegisterMethod · 0.95
FromFullNameFunction · 0.92
GraphQLFunction · 0.92
StringResponseFunction · 0.92
newTestClientFunction · 0.85
RepoMetadataFunction · 0.85
MembersToIDsMethod · 0.80
EqualMethod · 0.80
TeamsToIDsMethod · 0.80
LabelsToIDsMethod · 0.80
ProjectsTitlesToIDsMethod · 0.80
MilestoneToIDMethod · 0.80

Tested by

no test coverage detected