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

Function TestFollowManyActivityCopyLimit

client_test.go:68–90  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestFollowManyActivityCopyLimit(t *testing.T) {
69 var (
70 client, requester = newClient(t)
71 ctx = context.Background()
72 relationships = make([]stream.FollowRelationship, 3)
73 flat, _ = newFlatFeedWithUserID(client, "123")
74 )
75
76 for i := range relationships {
77 other, _ := newAggregatedFeedWithUserID(client, strconv.Itoa(i))
78 relationships[i] = stream.NewFollowRelationship(other, flat, stream.WithFollowRelationshipActivityCopyLimit(i))
79 }
80
81 err := client.FollowMany(ctx, relationships)
82 require.NoError(t, err)
83 body := `[{"source":"aggregated:0","target":"flat:123","activity_copy_limit":0},{"source":"aggregated:1","target":"flat:123","activity_copy_limit":1},{"source":"aggregated:2","target":"flat:123","activity_copy_limit":2}]`
84 testRequest(t, requester.req, http.MethodPost, "https://api.stream-io-api.com/api/v1.0/follow_many/?api_key=key", body)
85
86 err = client.FollowMany(ctx, relationships, stream.WithFollowManyActivityCopyLimit(123))
87 require.NoError(t, err)
88 body = `[{"source":"aggregated:0","target":"flat:123","activity_copy_limit":0},{"source":"aggregated:1","target":"flat:123","activity_copy_limit":1},{"source":"aggregated:2","target":"flat:123","activity_copy_limit":2}]`
89 testRequest(t, requester.req, http.MethodPost, "https://api.stream-io-api.com/api/v1.0/follow_many/?activity_copy_limit=123&api_key=key", body)
90}
91
92func TestUnfollowMany(t *testing.T) {
93 var (

Callers

nothing calls this directly

Calls 5

newClientFunction · 0.85
newFlatFeedWithUserIDFunction · 0.85
testRequestFunction · 0.85
FollowManyMethod · 0.80

Tested by

no test coverage detected