Merge branch 'main' into avm99963-monorail
Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266
GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/api/v3/test/monorail_servicer_test.py b/api/v3/test/monorail_servicer_test.py
index 2abcaf9..7d628ba 100644
--- a/api/v3/test/monorail_servicer_test.py
+++ b/api/v3/test/monorail_servicer_test.py
@@ -1,7 +1,6 @@
-# Copyright 2018 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file or at
-# https://developers.google.com/open-source/licenses/bsd
+# Copyright 2018 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Tests for MonorailServicer."""
from __future__ import print_function
@@ -75,11 +74,11 @@
pass
-class TestableServicer(monorail_servicer.MonorailServicer):
+class _TestableServicer(monorail_servicer.MonorailServicer):
"""Fake servicer class."""
def __init__(self, services):
- super(TestableServicer, self).__init__(services)
+ super(_TestableServicer, self).__init__(services)
self.was_called = False
self.seen_mc = None
self.seen_request = None
@@ -121,7 +120,7 @@
self.non_member = self.services.user.TestAddUser(
'nonmember@example.com', 222)
self.test_user = self.services.user.TestAddUser('test@example.com', 420)
- self.svcr = TestableServicer(self.services)
+ self.svcr = _TestableServicer(self.services)
self.nonmember_token = xsrf.GenerateToken(222, xsrf.XHR_SERVLET_PATH)
self.request = UpdateSomethingRequest(exc_class=None)
self.prpc_context = context.ServicerContext()
@@ -336,8 +335,8 @@
'email': 'bigbadwolf@gserviceaccount.com',
}
- with self.assertRaisesRegexp(
- permissions.PermissionException, r'Account .+ is not allowlisted'):
+ with self.assertRaisesRegex(permissions.PermissionException,
+ r'Account .+ is not allowlisted'):
self.svcr.GetAndAssertRequesterAuth(self.cnxn, metadata, self.services)
@mock.patch('google.oauth2.id_token.verify_oauth2_token')
@@ -355,8 +354,8 @@
'email': allowlisted_service_account_email.email,
}
- with self.assertRaisesRegexp(
- permissions.PermissionException, r'Invalid token audience: .+'):
+ with self.assertRaisesRegex(permissions.PermissionException,
+ r'Invalid token audience: .+'):
self.svcr.GetAndAssertRequesterAuth(self.cnxn, metadata, self.services)
@mock.patch('google.oauth2.id_token.verify_oauth2_token')
@@ -373,8 +372,8 @@
'email': 'some-other-site-user@test.com',
}
- with self.assertRaisesRegexp(
- permissions.PermissionException, r'Client .+ is not allowlisted'):
+ with self.assertRaisesRegex(permissions.PermissionException,
+ r'Client .+ is not allowlisted'):
self.svcr.GetAndAssertRequesterAuth(self.cnxn, metadata, self.services)
# Assert some-other-site-user was not auto-created.