MCPcopy Create free account
hub / github.com/cli/cli / TestRunUnmarkTemplate_Org

Function TestRunUnmarkTemplate_Org

pkg/cmd/project/mark-template/mark_template_test.go:184–275  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

182}
183
184func TestRunUnmarkTemplate_Org(t *testing.T) {
185 defer gock.Off()
186 gock.Observe(gock.DumpRequest)
187
188 // get org ID
189 gock.New("https://api.github.com").
190 Post("/graphql").
191 MatchType("json").
192 JSON(map[string]interface{}{
193 "query": "query UserOrgOwner.*",
194 "variables": map[string]interface{}{
195 "login": "github",
196 },
197 }).
198 Reply(200).
199 JSON(map[string]interface{}{
200 "data": map[string]interface{}{
201 "organization": map[string]interface{}{
202 "id": "an ID",
203 },
204 },
205 "errors": []interface{}{
206 map[string]interface{}{
207 "type": "NOT_FOUND",
208 "path": []string{"user"},
209 },
210 },
211 })
212
213 // get project ID
214 gock.New("https://api.github.com").
215 Post("/graphql").
216 MatchType("json").
217 JSON(map[string]interface{}{
218 "query": "query OrgProject.*",
219 "variables": map[string]interface{}{
220 "login": "github",
221 "number": 1,
222 "firstItems": 0,
223 "afterItems": nil,
224 "firstFields": 0,
225 "afterFields": nil,
226 },
227 }).
228 Reply(200).
229 JSON(map[string]interface{}{
230 "data": map[string]interface{}{
231 "organization": map[string]interface{}{
232 "projectV2": map[string]interface{}{
233 "id": "an ID",
234 },
235 },
236 },
237 })
238
239 // template project
240 gock.New("https://api.github.com").
241 Post("/graphql").

Callers

nothing calls this directly

Calls 7

NewTestClientFunction · 0.92
TestFunction · 0.92
runMarkTemplateFunction · 0.85
ReplyMethod · 0.80
SetStdoutTTYMethod · 0.80
EqualMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…