예제 #1
0
 def testNoFlags(self):
   namespace = self.parser.parse_args([])
   # No exception means everything is OK
   flags.Validate(namespace)
예제 #2
0
 def testSqlMissingServiceAccountPresent(self):
   namespace = self.parser.parse_args(['--service-account=alsoblah'])
   # No exception means everything is OK
   flags.Validate(namespace)
예제 #3
0
 def testSqlMissingADCtPresent(self):
   namespace = self.parser.parse_args(['--application-default-credential'])
   # No exception means everything is OK
   flags.Validate(namespace)
예제 #4
0
 def testSqlExistsADCPresent(self):
   namespace = self.parser.parse_args(
       ['--cloudsql-instances=blah', '--application-default-credential'])
   # No exception means everything is OK
   flags.Validate(namespace)
예제 #5
0
 def testSqlExistsServiceAccountPresent(self):
   namespace = self.parser.parse_args(
       ['--cloudsql-instances=blah', '--service-account=alsoblah'])
   # No exception means everything is OK
   flags.Validate(namespace)
예제 #6
0
 def testSqlExistsServiceAccountMissing(self):
   with self.assertRaises(flags.InvalidFlagError):
     namespace = self.parser.parse_args(['--cloudsql-instances=blah'])
     flags.Validate(namespace)
예제 #7
0
 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