MCPcopy Index your code
hub / github.com/google/go-github / TestRepositoriesService_Unsubscribe

Function TestRepositoriesService_Unsubscribe

github/repos_hooks_test.go:593–624  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

591}
592
593func TestRepositoriesService_Unsubscribe(t *testing.T) {
594 t.Parallel()
595 client, mux, _ := setup(t)
596
597 mux.HandleFunc("/hub", func(_ http.ResponseWriter, r *http.Request) {
598 testMethod(t, r, "POST")
599 testHeader(t, r, "Content-Type", "application/x-www-form-urlencoded")
600 testFormValues(t, r, values{
601 "hub.mode": "unsubscribe",
602 "hub.topic": "https://github.com/o/r/events/push",
603 "hub.callback": "http://localhost:8080/callback",
604 "hub.secret": "test secret",
605 })
606 })
607
608 ctx := t.Context()
609 _, err := client.Repositories.Unsubscribe(
610 ctx,
611 "o",
612 "r",
613 "push",
614 "http://localhost:8080/callback",
615 []byte("test secret"),
616 )
617 if err != nil {
618 t.Errorf("Repositories.Unsubscribe returned error: %v", err)
619 }
620
621 testNewRequestAndDoFailure(t, "Unsubscribe", client, func() (*Response, error) {
622 return client.Repositories.Unsubscribe(ctx, "o", "r", "push", "http://localhost:8080/callback", nil)
623 })
624}

Callers

nothing calls this directly

Calls 6

testMethodFunction · 0.85
testHeaderFunction · 0.85
testFormValuesFunction · 0.85
UnsubscribeMethod · 0.80
setupFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…