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

Method GetSingleKeyspace

rest/utilities_testing.go:2528–2536  ·  view source on GitHub ↗

GetSingleKeyspace the name of the keyspace if there is only one test collection on one database.

()

Source from the content-addressed store, hash-verified

2526
2527// GetSingleKeyspace the name of the keyspace if there is only one test collection on one database.
2528func (rt *RestTester) GetSingleKeyspace() string {
2529 db := rt.GetDatabase()
2530 require.Equal(rt.TB(), 1, len(db.CollectionByID), "Database must be configured with only one collection to use this function")
2531 for _, collection := range db.CollectionByID {
2532 return getRESTKeyspace(rt.TB(), db.Name, collection)
2533 }
2534 rt.TB().Fatal("Had no collection to return a keyspace for") // should be unreachable given length check above
2535 return ""
2536}
2537
2538// getCollectionsForBLIP returns scope.collection strings for blip to process GetCollections messages. To test legacy functionality when SG_TEST_USE_DEFAULT_COLLECTION=true, don't return default collection if it is the only collection available.
2539func (rt *RestTester) getCollectionsForBLIP() []string {

Callers 11

UpdateDocMethod · 0.95
DeleteDocMethod · 0.95
TestMetricsHandlerFunction · 0.95
RequireDocNotFoundMethod · 0.95
PurgeDocMethod · 0.95
TestHTTPLoggingRedactionFunction · 0.95
templateResourceMethod · 0.95

Calls 4

GetDatabaseMethod · 0.95
TBMethod · 0.95
getRESTKeyspaceFunction · 0.85
EqualMethod · 0.45