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

Function GetSingleDatabaseCollectionWithUser

db/util_testing.go:658–664  ·  view source on GitHub ↗
(ctx context.Context, tb testing.TB, database *Database)

Source from the content-addressed store, hash-verified

656}
657
658func GetSingleDatabaseCollectionWithUser(ctx context.Context, tb testing.TB, database *Database) (*DatabaseCollectionWithUser, context.Context) {
659 c := &DatabaseCollectionWithUser{
660 DatabaseCollection: GetSingleDatabaseCollection(tb, database.DatabaseContext),
661 user: database.user,
662 }
663 return c, c.AddCollectionContext(ctx)
664}
665
666func GetSingleDatabaseCollection(tb testing.TB, database *DatabaseContext) *DatabaseCollection {
667 require.Equal(tb, 1, len(database.CollectionByID), fmt.Sprintf("Database must only have a single collection configured has %d", len(database.CollectionByID)))

Callers 15

TestFeedImportFunction · 0.85
TestOnDemandImportFunction · 0.85
TestMigrateMetadataFunction · 0.85
TestImportNullDocFunction · 0.85
TestImportNullDocRawFunction · 0.85
TestImportNonZeroStartFunction · 0.85

Calls 2

AddCollectionContextMethod · 0.80

Tested by 15

TestFeedImportFunction · 0.68
TestOnDemandImportFunction · 0.68
TestMigrateMetadataFunction · 0.68
TestImportNullDocFunction · 0.68
TestImportNullDocRawFunction · 0.68
TestImportNonZeroStartFunction · 0.68