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

Function TestRunDelete_Org

pkg/cmd/project/delete/delete_test.go:176–266  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

NewTestClientFunction · 0.92
TestFunction · 0.92
ReplyMethod · 0.80
SetStdoutTTYMethod · 0.80
EqualMethod · 0.80
runDeleteFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected