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

Function TestGetDatabaseCollectionWithUserScopesNil

db/database_test.go:4226–4250  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

4224}
4225
4226func TestGetDatabaseCollectionWithUserScopesNil(t *testing.T) {
4227 testCases := []struct {
4228 scope string
4229 collection string
4230 }{
4231 {
4232 scope: "",
4233 collection: "",
4234 },
4235 {
4236 scope: "foo",
4237 collection: "bar",
4238 },
4239 }
4240
4241 for _, testCase := range testCases {
4242 t.Run(fmt.Sprintf("%s.%s", testCase.scope, testCase.collection), func(t *testing.T) {
4243
4244 db := Database{DatabaseContext: &DatabaseContext{}}
4245 col, err := db.GetDatabaseCollectionWithUser(testCase.scope, testCase.collection)
4246 require.Error(t, err)
4247 require.Nil(t, col)
4248 })
4249 }
4250}
4251
4252func TestGetDatabaseCollectionWithUserNoScopesConfigured(t *testing.T) {
4253 testCases := []struct {

Callers

nothing calls this directly

Calls 3

RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected