getScopeAndCollectionFromKeyspace returns the scope and collection from a keyspace, e.g. /db/ -> _default._default , or /db.scope1.collection1 -> scope1.collection1
(t testing.TB, keyspace string)
| 2480 | |
| 2481 | // getScopeAndCollectionFromKeyspace returns the scope and collection from a keyspace, e.g. /db/ -> _default._default , or /db.scope1.collection1 -> scope1.collection1 |
| 2482 | func getScopeAndCollectionFromKeyspace(t testing.TB, keyspace string) string { |
| 2483 | _, scope, collection, err := ParseKeyspace(keyspace) |
| 2484 | require.NoError(t, err) |
| 2485 | if scope == nil && collection == nil { |
| 2486 | return strings.Join([]string{base.DefaultScope, base.DefaultCollection}, base.ScopeCollectionSeparator) |
| 2487 | } |
| 2488 | require.NotNil(t, scope, "Expected scope to be non-nil for %s", keyspace) |
| 2489 | require.NotNil(t, collection, "Expected collection to be non-nil for %s", keyspace) |
| 2490 | return strings.Join([]string{*scope, *collection}, base.ScopeCollectionSeparator) |
| 2491 | } |
| 2492 | |
| 2493 | // getKeyspaces returns the names of all the keyspaces on the rest tester. Currently assumes a single database. |
| 2494 | func getKeyspaces(t testing.TB, database *db.DatabaseContext) []string { |
no test coverage detected