Example #1
0
  def testApprovalValidation(self):
    # String instead of list of users
    with self.assertRaises(
        client_approval_auth.ErrorInvalidClientApprovalAuthorization):
      client_approval_auth.ClientApprovalAuthorization(
          label="label", users="test")

    # Missing label
    acl = client_approval_auth.ClientApprovalAuthorization(users=["test"])
    with self.assertRaises(
        client_approval_auth.ErrorInvalidClientApprovalAuthorization):
      print(acl.label)

    # Bad label
    with self.assertRaises(
        client_approval_auth.ErrorInvalidClientApprovalAuthorization):
      acl.label = None
Example #2
0
 def GenerateSample(self, number=0):
   return client_approval_auth.ClientApprovalAuthorization(
       label="label%d" % number, users=["test", "test2"])