MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / newRestTester

Function newRestTester

rest/utilities_testing.go:168–183  ·  view source on GitHub ↗

newRestTester creates the underlying rest testers, use public functions.

(tb testing.TB, restConfig *RestTesterConfig, collectionConfig collectionConfiguration, numCollections int)

Source from the content-addressed store, hash-verified

166
167// newRestTester creates the underlying rest testers, use public functions.
168func newRestTester(tb testing.TB, restConfig *RestTesterConfig, collectionConfig collectionConfiguration, numCollections int) *RestTester {
169 var rt RestTester
170 if tb == nil {
171 panic("tester parameter cannot be nil")
172 }
173 rt.testingTB.Store(&tb)
174 if restConfig != nil {
175 rt.RestTesterConfig = restConfig
176 } else {
177 rt.RestTesterConfig = &RestTesterConfig{}
178 }
179 rt.RestTesterConfig.collectionConfig = collectionConfig
180 rt.RestTesterConfig.numCollections = numCollections
181 rt.RestTesterConfig.useTLSServer = base.ServerIsTLS(base.UnitTestUrl())
182 return &rt
183}
184
185// NewRestTester returns a rest tester backed by a single database and a single default collection.
186func NewRestTesterDefaultCollection(tb testing.TB, restConfig *RestTesterConfig) *RestTester {

Calls 3

ServerIsTLSFunction · 0.92
UnitTestUrlFunction · 0.92
StoreMethod · 0.80

Tested by

no test coverage detected