def testNoFlags(self): namespace = self.parser.parse_args([]) # No exception means everything is OK flags.Validate(namespace)
def testSqlMissingServiceAccountPresent(self): namespace = self.parser.parse_args(['--service-account=alsoblah']) # No exception means everything is OK flags.Validate(namespace)
def testSqlMissingADCtPresent(self): namespace = self.parser.parse_args(['--application-default-credential']) # No exception means everything is OK flags.Validate(namespace)
def testSqlExistsADCPresent(self): namespace = self.parser.parse_args( ['--cloudsql-instances=blah', '--application-default-credential']) # No exception means everything is OK flags.Validate(namespace)
def testSqlExistsServiceAccountPresent(self): namespace = self.parser.parse_args( ['--cloudsql-instances=blah', '--service-account=alsoblah']) # No exception means everything is OK flags.Validate(namespace)
def testSqlExistsServiceAccountMissing(self): with self.assertRaises(flags.InvalidFlagError): namespace = self.parser.parse_args(['--cloudsql-instances=blah']) flags.Validate(namespace)
def Filter(self, context, args): flags.Validate(args) return context
def Filter(self, context, args): # TODO(b/190528427): Determine if command group works with project number base.RequireProjectID(args) flags.Validate(args) return context