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

Function TestFollowMany

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

Source from the content-addressed store, hash-verified

42}
43
44func TestFollowMany(t *testing.T) {
45 var (
46 client, requester = newClient(t)
47 ctx = context.Background()
48 relationships = make([]stream.FollowRelationship, 3)
49 flat, _ = newFlatFeedWithUserID(client, "123")
50 )
51
52 for i := range relationships {
53 other, _ := newAggregatedFeedWithUserID(client, strconv.Itoa(i))
54 relationships[i] = stream.NewFollowRelationship(other, flat)
55 }
56
57 err := client.FollowMany(ctx, relationships)
58 require.NoError(t, err)
59 body := `[{"source":"aggregated:0","target":"flat:123"},{"source":"aggregated:1","target":"flat:123"},{"source":"aggregated:2","target":"flat:123"}]`
60 testRequest(t, requester.req, http.MethodPost, "https://api.stream-io-api.com/api/v1.0/follow_many/?api_key=key", body)
61
62 err = client.FollowMany(ctx, relationships, stream.WithFollowManyActivityCopyLimit(500))
63 require.NoError(t, err)
64 body = `[{"source":"aggregated:0","target":"flat:123"},{"source":"aggregated:1","target":"flat:123"},{"source":"aggregated:2","target":"flat:123"}]`
65 testRequest(t, requester.req, http.MethodPost, "https://api.stream-io-api.com/api/v1.0/follow_many/?activity_copy_limit=500&api_key=key", body)
66}
67
68func TestFollowManyActivityCopyLimit(t *testing.T) {
69 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