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

Function createSubscription

test/integration/activity_test.go:91–107  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func 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
109func TestActivity_Watching(t *testing.T) {
110 watchers, _, err := client.Activity.ListWatchers(t.Context(), owner, repo, nil)

Callers 1

TestActivity_WatchingFunction · 0.85

Calls 3

PtrFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…