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

Function TestDeleteManyCollectionObjects

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

Source from the content-addressed store, hash-verified

98}
99
100func TestDeleteManyCollectionObjects(t *testing.T) {
101 ctx := context.Background()
102 client, requester := newClient(t)
103 testCases := []struct {
104 ids []string
105 collection string
106 expectedURL string
107 }{
108 {
109 collection: "test-single",
110 ids: []string{"one"},
111 expectedURL: "https://api.stream-io-api.com/api/v1.0/collections/?api_key=key&collection_name=test-single&ids=one",
112 },
113 {
114 collection: "test-many",
115 ids: []string{"one", "two", "three"},
116 expectedURL: "https://api.stream-io-api.com/api/v1.0/collections/?api_key=key&collection_name=test-many&ids=one%2Ctwo%2Cthree",
117 },
118 }
119 for _, tc := range testCases {
120 _, err := client.Collections().DeleteMany(ctx, tc.collection, tc.ids...)
121 require.NoError(t, err)
122 testRequest(t, requester.req, http.MethodDelete, tc.expectedURL, "")
123 }
124}
125
126func TestGetCollectionObject(t *testing.T) {
127 ctx := context.Background()

Callers

nothing calls this directly

Calls 4

newClientFunction · 0.85
testRequestFunction · 0.85
DeleteManyMethod · 0.80
CollectionsMethod · 0.80

Tested by

no test coverage detected