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

Method GetDatabase

rest/utilities_testing.go:534–540  ·  view source on GitHub ↗

GetDatabase Returns a database found for server context, if there is only one database. Fails the test harness if there is not a database defined.

()

Source from the content-addressed store, hash-verified

532
533// GetDatabase Returns a database found for server context, if there is only one database. Fails the test harness if there is not a database defined.
534func (rt *RestTester) GetDatabase() *db.DatabaseContext {
535 require.Len(rt.TB(), rt.ServerContext().AllDatabases(), 1)
536 for _, database := range rt.ServerContext().AllDatabases() {
537 return database
538 }
539 return nil
540}
541
542// CreateUser creates a user with the default password and channels scoped to a single test collection.
543func (rt *RestTester) CreateUser(username string, channels []string, roles ...string) {

Calls 4

TBMethod · 0.95
ServerContextMethod · 0.95
AllDatabasesMethod · 0.80
LenMethod · 0.65