(t *testing.T)
| 89 | } |
| 90 | |
| 91 | func createSubscription(t *testing.T) { |
| 92 | // watch the target repository |
| 93 | sub := &github.Subscription{Subscribed: github.Ptr(true)} |
| 94 | _, _, err := client.Activity.SetRepositorySubscription(t.Context(), owner, repo, sub) |
| 95 | if err != nil { |
| 96 | t.Fatalf("Activity.SetRepositorySubscription returned error: %v", err) |
| 97 | } |
| 98 | |
| 99 | // check again and verify watching |
| 100 | sub, _, err = client.Activity.GetRepositorySubscription(t.Context(), owner, repo) |
| 101 | if err != nil { |
| 102 | t.Fatalf("Activity.GetRepositorySubscription returned error: %v", err) |
| 103 | } |
| 104 | if sub == nil || !*sub.Subscribed { |
| 105 | t.Fatalf("Not watching %v/%v after setting subscription.", owner, repo) |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | func TestActivity_Watching(t *testing.T) { |
| 110 | watchers, _, err := client.Activity.ListWatchers(t.Context(), owner, repo, nil) |
no test coverage detected
searching dependent graphs…