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

Function TestSelectCollectionObjects

collections_test.go:73–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestSelectCollectionObjects(t *testing.T) {
74 ctx := context.Background()
75 client, requester := newClient(t)
76 testCases := []struct {
77 ids []string
78 collection string
79 expectedURL string
80 expectedBody string
81 }{
82 {
83 collection: "test-single",
84 ids: []string{"one"},
85 expectedURL: "https://api.stream-io-api.com/api/v1.0/collections/?api_key=key&foreign_ids=" + url.QueryEscape("test-single:one"),
86 },
87 {
88 collection: "test-multiple",
89 ids: []string{"one", "two", "three"},
90 expectedURL: "https://api.stream-io-api.com/api/v1.0/collections/?api_key=key&foreign_ids=" + url.QueryEscape("test-multiple:one,test-multiple:two,test-multiple:three"),
91 },
92 }
93 for _, tc := range testCases {
94 _, err := client.Collections().Select(ctx, tc.collection, tc.ids...)
95 require.NoError(t, err)
96 testRequest(t, requester.req, http.MethodGet, tc.expectedURL, tc.expectedBody)
97 }
98}
99
100func TestDeleteManyCollectionObjects(t *testing.T) {
101 ctx := context.Background()

Callers

nothing calls this directly

Calls 4

newClientFunction · 0.85
testRequestFunction · 0.85
SelectMethod · 0.80
CollectionsMethod · 0.80

Tested by

no test coverage detected