MCPcopy Create free account
hub / github.com/GetStream/stream-go2 / TestGetFollowing

Function TestGetFollowing

feed_test.go:117–140  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestGetFollowing(t *testing.T) {
118 var (
119 client, requester = newClient(t)
120 ctx = context.Background()
121 f1, _ = newFlatFeedWithUserID(client, "f1")
122 )
123 testCases := []struct {
124 opts []stream.FollowingOption
125 expected string
126 }{
127 {
128 expected: "https://api.stream-io-api.com/api/v1.0/feed/flat/f1/follows/?api_key=key",
129 },
130 {
131 opts: []stream.FollowingOption{stream.WithFollowingFilter("filter"), stream.WithFollowingLimit(42), stream.WithFollowingOffset(84)},
132 expected: "https://api.stream-io-api.com/api/v1.0/feed/flat/f1/follows/?api_key=key&filter=filter&limit=42&offset=84",
133 },
134 }
135 for _, tc := range testCases {
136 _, err := f1.GetFollowing(ctx, tc.opts...)
137 require.NoError(t, err)
138 testRequest(t, requester.req, http.MethodGet, tc.expected, "")
139 }
140}
141
142func TestGetFollowers(t *testing.T) {
143 var (

Callers

nothing calls this directly

Calls 4

newClientFunction · 0.85
newFlatFeedWithUserIDFunction · 0.85
testRequestFunction · 0.85
GetFollowingMethod · 0.65

Tested by

no test coverage detected