(t *testing.T)
| 591 | } |
| 592 | |
| 593 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…