Merge branch 'main' into avm99963-monorail

Merged commit 3779da353b36d43cf778e7d4f468097714dd4540

GitOrigin-RevId: 6451a5c6b75afb0fd1f37b3f14521148d0722ea8
diff --git a/api/test/features_servicer_test.py b/api/test/features_servicer_test.py
index 177bc3f..21154de 100644
--- a/api/test/features_servicer_test.py
+++ b/api/test/features_servicer_test.py
@@ -9,7 +9,10 @@
 from __future__ import absolute_import
 
 import unittest
-import mox
+try:
+  from mox3 import mox
+except ImportError:
+  import mox
 
 from components.prpc import codes
 from components.prpc import context
diff --git a/api/test/issues_servicer_test.py b/api/test/issues_servicer_test.py
index 2c46f7c..0ba50ac 100644
--- a/api/test/issues_servicer_test.py
+++ b/api/test/issues_servicer_test.py
@@ -8,7 +8,6 @@
 from __future__ import division
 from __future__ import absolute_import
 
-import logging
 import sys
 import time
 import unittest
@@ -18,7 +17,6 @@
 
 from components.prpc import codes
 from components.prpc import context
-from components.prpc import server
 
 from api import issues_servicer
 from api import converters
@@ -76,7 +74,7 @@
     self.issues_svcr = issues_servicer.IssuesServicer(
         self.services, make_rate_limiter=False)
     self.prpc_context = context.ServicerContext()
-    self.prpc_context.set_code(server.StatusCode.OK)
+    self.prpc_context.set_code(codes.StatusCode.OK)
     self.auth = authdata.AuthData(user_id=333, email='approver3@example.com')
 
     self.fd_1 = tracker_pb2.FieldDef(
diff --git a/api/test/monorail_servicer_test.py b/api/test/monorail_servicer_test.py
index 8c5a1d3..3c2d8a6 100644
--- a/api/test/monorail_servicer_test.py
+++ b/api/test/monorail_servicer_test.py
@@ -11,9 +11,11 @@
 import time
 import unittest
 import mock
-import mox
+try:
+  from mox3 import mox
+except ImportError:
+  import mox
 
-from components.prpc import server
 from components.prpc import codes
 from components.prpc import context
 from google.appengine.ext import testbed
diff --git a/api/test/projects_servicer_test.py b/api/test/projects_servicer_test.py
index b3084c3..683fa90 100644
--- a/api/test/projects_servicer_test.py
+++ b/api/test/projects_servicer_test.py
@@ -13,16 +13,13 @@
 
 from components.prpc import codes
 from components.prpc import context
-from components.prpc import server
 
 from api import projects_servicer
 from api.api_proto import common_pb2
 from api.api_proto import issue_objects_pb2
 from api.api_proto import project_objects_pb2
 from api.api_proto import projects_pb2
-from framework import authdata
 from framework import exceptions
-from framework import framework_constants
 from framework import monorailcontext
 from framework import permissions
 from proto import tracker_pb2
diff --git a/api/test/sitewide_servicer_test.py b/api/test/sitewide_servicer_test.py
index 3259fbb..a15fc75 100644
--- a/api/test/sitewide_servicer_test.py
+++ b/api/test/sitewide_servicer_test.py
@@ -12,9 +12,6 @@
 import unittest
 
 import mock
-from components.prpc import codes
-from components.prpc import context
-from components.prpc import server
 
 import settings
 from api import sitewide_servicer
diff --git a/api/test/users_servicer_test.py b/api/test/users_servicer_test.py
index aa25d18..f9b6480 100644
--- a/api/test/users_servicer_test.py
+++ b/api/test/users_servicer_test.py
@@ -10,10 +10,12 @@
 
 import unittest
 
-import mox
+try:
+  from mox3 import mox
+except ImportError:
+  import mox
 from components.prpc import codes
 from components.prpc import context
-from components.prpc import server
 
 from api import users_servicer
 from api.api_proto import common_pb2