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

Function Test_removeRun_repo

pkg/cmd/secret/delete/delete_test.go:280–375  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

278}
279
280func Test_removeRun_repo(t *testing.T) {
281 tests := []struct {
282 name string
283 opts *DeleteOptions
284 host string
285 httpStubs func(*httpmock.Registry)
286 }{
287 {
288 name: "Actions",
289 opts: &DeleteOptions{
290 Application: "actions",
291 SecretName: "cool_secret",
292 },
293 host: "github.com",
294 httpStubs: func(reg *httpmock.Registry) {
295 reg.Register(httpmock.WithHost(httpmock.REST("DELETE", "repos/owner/repo/actions/secrets/cool_secret"), "api.github.com"), httpmock.StatusStringResponse(204, "No Content"))
296 },
297 },
298 {
299 name: "Actions GHES",
300 opts: &DeleteOptions{
301 Application: "actions",
302 SecretName: "cool_secret",
303 },
304 host: "example.com",
305 httpStubs: func(reg *httpmock.Registry) {
306 reg.Register(httpmock.WithHost(httpmock.REST("DELETE", "api/v3/repos/owner/repo/actions/secrets/cool_secret"), "example.com"), httpmock.StatusStringResponse(204, "No Content"))
307 },
308 },
309 {
310 name: "Dependabot",
311 opts: &DeleteOptions{
312 Application: "dependabot",
313 SecretName: "cool_dependabot_secret",
314 },
315 host: "github.com",
316 httpStubs: func(reg *httpmock.Registry) {
317 reg.Register(httpmock.WithHost(httpmock.REST("DELETE", "repos/owner/repo/dependabot/secrets/cool_dependabot_secret"), "api.github.com"), httpmock.StatusStringResponse(204, "No Content"))
318 },
319 },
320 {
321 name: "Dependabot GHES",
322 opts: &DeleteOptions{
323 Application: "dependabot",
324 SecretName: "cool_dependabot_secret",
325 },
326 host: "example.com",
327 httpStubs: func(reg *httpmock.Registry) {
328 reg.Register(httpmock.WithHost(httpmock.REST("DELETE", "api/v3/repos/owner/repo/dependabot/secrets/cool_dependabot_secret"), "example.com"), httpmock.StatusStringResponse(204, "No Content"))
329 },
330 },
331 {
332 name: "Agents",
333 opts: &DeleteOptions{
334 Application: "agents",
335 SecretName: "cool_agents_secret",
336 },
337 host: "github.com",

Callers

nothing calls this directly

Calls 9

RegisterMethod · 0.95
VerifyMethod · 0.95
WithHostFunction · 0.92
RESTFunction · 0.92
StatusStringResponseFunction · 0.92
TestFunction · 0.92
NewBlankConfigFunction · 0.92
FromFullNameWithHostFunction · 0.92
removeRunFunction · 0.70

Tested by

no test coverage detected