Merge branch 'main' into avm99963-monorail
Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266
GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/project/test/peopledetail_test.py b/project/test/peopledetail_test.py
index 547df80..792ffb2 100644
--- a/project/test/peopledetail_test.py
+++ b/project/test/peopledetail_test.py
@@ -1,7 +1,6 @@
-# Copyright 2016 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 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Unittest for the people detail page."""
from __future__ import print_function
@@ -12,13 +11,11 @@
import unittest
-import webapp2
-
from framework import authdata
from framework import exceptions
from framework import permissions
from project import peopledetail
-from proto import project_pb2
+from mrproto import project_pb2
from services import service_manager
from testing import fake
from testing import testing_helpers
@@ -39,7 +36,7 @@
self.project.owner_ids.extend([111, 222])
self.project.committer_ids.extend([333, 444])
self.project.contributor_ids.extend([555])
- self.servlet = peopledetail.PeopleDetail('req', 'res', services=services)
+ self.servlet = peopledetail.PeopleDetail(services=services)
def VerifyAccess(self, exception_expected):
mr = testing_helpers.MakeMonorailRequest(
@@ -127,12 +124,12 @@
333, self.servlet.ValidateMemberID('fake cnxn', 333, self.project))
# 404 for user that does not exist
- with self.assertRaises(webapp2.HTTPException) as cm:
+ with self.assertRaises(Exception) as cm:
self.servlet.ValidateMemberID('fake cnxn', 8933, self.project)
self.assertEqual(404, cm.exception.code)
# 404 for valid user that is not in this project
- with self.assertRaises(webapp2.HTTPException) as cm:
+ with self.assertRaises(Exception) as cm:
self.servlet.ValidateMemberID('fake cnxn', 999, self.project)
self.assertEqual(404, cm.exception.code)
diff --git a/project/test/peoplelist_test.py b/project/test/peoplelist_test.py
index 6620df9..5459763 100644
--- a/project/test/peoplelist_test.py
+++ b/project/test/peoplelist_test.py
@@ -1,7 +1,6 @@
-# Copyright 2016 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 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Unittest for People List servlet."""
from __future__ import print_function
@@ -13,7 +12,7 @@
from framework import authdata
from framework import permissions
from project import peoplelist
-from proto import user_pb2
+from mrproto import user_pb2
from services import service_manager
from testing import fake
from testing import testing_helpers
@@ -35,7 +34,7 @@
self.project.owner_ids.extend([111])
self.project.committer_ids.extend([222])
self.project.contributor_ids.extend([333])
- self.servlet = peoplelist.PeopleList('req', 'res', services=services)
+ self.servlet = peoplelist.PeopleList(services=services)
def VerifyAccess(self, exception_expected):
mr = testing_helpers.MakeMonorailRequest(
diff --git a/project/test/project_helpers_test.py b/project/test/project_helpers_test.py
index 4732895..5252c77 100644
--- a/project/test/project_helpers_test.py
+++ b/project/test/project_helpers_test.py
@@ -1,7 +1,6 @@
-# Copyright 2016 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 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Unit tests for helpers module."""
from __future__ import print_function
@@ -16,7 +15,7 @@
from framework import permissions
from project import project_constants
from project import project_helpers
-from proto import project_pb2
+from mrproto import project_pb2
from services import service_manager
from testing import fake
diff --git a/project/test/project_views_test.py b/project/test/project_views_test.py
index 940116e..a6b0ce5 100644
--- a/project/test/project_views_test.py
+++ b/project/test/project_views_test.py
@@ -1,7 +1,6 @@
-# Copyright 2016 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 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Unit tests for project_views module."""
from __future__ import print_function
@@ -12,7 +11,7 @@
from framework import framework_views
from project import project_views
-from proto import project_pb2
+from mrproto import project_pb2
from services import service_manager
from testing import fake
diff --git a/project/test/projectadmin_test.py b/project/test/projectadmin_test.py
index 0257cd0..0b2dc82 100644
--- a/project/test/projectadmin_test.py
+++ b/project/test/projectadmin_test.py
@@ -1,7 +1,6 @@
-# Copyright 2016 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 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Unit tests for projectadmin module."""
from __future__ import print_function
@@ -12,7 +11,7 @@
from framework import permissions
from project import projectadmin
-from proto import project_pb2
+from mrproto import project_pb2
from services import service_manager
from testing import fake
from testing import testing_helpers
@@ -25,7 +24,7 @@
services = service_manager.Services(
project=fake.ProjectService(),
user=fake.UserService())
- self.servlet = projectadmin.ProjectAdmin('req', 'res', services=services)
+ self.servlet = projectadmin.ProjectAdmin(services=services)
self.project = services.project.TestAddProject(
'proj', summary='a summary', description='a description')
self.request, self.mr = testing_helpers.GetRequestObjects(
diff --git a/project/test/projectadminadvanced_test.py b/project/test/projectadminadvanced_test.py
index a654d98..bf1c5f1 100644
--- a/project/test/projectadminadvanced_test.py
+++ b/project/test/projectadminadvanced_test.py
@@ -1,7 +1,6 @@
-# Copyright 2016 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 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Unit tests for projectadminadvanced module."""
from __future__ import print_function
@@ -14,7 +13,7 @@
from framework import permissions
from project import projectadminadvanced
-from proto import project_pb2
+from mrproto import project_pb2
from services import service_manager
from testing import fake
from testing import testing_helpers
@@ -28,8 +27,7 @@
def setUp(self):
services = service_manager.Services(
project=fake.ProjectService())
- self.servlet = projectadminadvanced.ProjectAdminAdvanced(
- 'req', 'res', services=services)
+ self.servlet = projectadminadvanced.ProjectAdminAdvanced(services=services)
self.project = services.project.TestAddProject('proj', owner_ids=[111])
self.mr = testing_helpers.MakeMonorailRequest(
project=self.project,
diff --git a/project/test/projectexport_test.py b/project/test/projectexport_test.py
index 6dbe990..d575f2a 100644
--- a/project/test/projectexport_test.py
+++ b/project/test/projectexport_test.py
@@ -1,7 +1,6 @@
-# Copyright 2016 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 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Unittests for the projectexport servlet."""
from __future__ import print_function
@@ -14,7 +13,7 @@
from framework import permissions
from project import projectexport
-from proto import tracker_pb2
+from mrproto import tracker_pb2
from services import service_manager
from services.template_svc import TemplateService
from testing import fake
@@ -25,8 +24,7 @@
def setUp(self):
self.services = service_manager.Services()
- self.servlet = projectexport.ProjectExport(
- 'req', 'res', services=self.services)
+ self.servlet = projectexport.ProjectExport(services=self.services)
def testAssertBasePermission(self):
mr = testing_helpers.MakeMonorailRequest(
@@ -46,8 +44,7 @@
user=fake.UserService(),
template=Mock(spec=TemplateService))
self.services.user.TestAddUser('user1@example.com', 111)
- self.servlet = projectexport.ProjectExportJSON(
- 'req', 'res', services=self.services)
+ self.servlet = projectexport.ProjectExportJSON(services=self.services)
self.project = fake.Project(project_id=789)
self.mr = testing_helpers.MakeMonorailRequest(
perms=permissions.OWNER_ACTIVE_PERMISSIONSET)
diff --git a/project/test/projectsummary_test.py b/project/test/projectsummary_test.py
index 32b2fde..6f6373b 100644
--- a/project/test/projectsummary_test.py
+++ b/project/test/projectsummary_test.py
@@ -1,7 +1,6 @@
-# Copyright 2016 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 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Unittests for Project Summary servlet."""
from __future__ import print_function
@@ -12,8 +11,8 @@
from framework import permissions
from project import projectsummary
-from proto import project_pb2
-from proto import user_pb2
+from mrproto import project_pb2
+from mrproto import user_pb2
from services import service_manager
from testing import fake
from testing import testing_helpers
@@ -30,8 +29,7 @@
self.project = services.project.TestAddProject(
'proj', project_id=123, summary='sum',
description='desc')
- self.servlet = projectsummary.ProjectSummary(
- 'req', 'res', services=services)
+ self.servlet = projectsummary.ProjectSummary(services=services)
def testGatherPageData(self):
mr = testing_helpers.MakeMonorailRequest(project=self.project)
diff --git a/project/test/projectupdates_test.py b/project/test/projectupdates_test.py
index e4c5cea..56cadce 100644
--- a/project/test/projectupdates_test.py
+++ b/project/test/projectupdates_test.py
@@ -1,7 +1,6 @@
-# Copyright 2016 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 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Unittests for monorail.project.projectupdates."""
from __future__ import print_function
@@ -36,8 +35,7 @@
self.mr = testing_helpers.MakeMonorailRequest(
services=self.services, project=self.project)
self.mr.project_name = self.project_name
- self.project_updates = projectupdates.ProjectUpdates(
- None, None, self.services)
+ self.project_updates = projectupdates.ProjectUpdates(self.services)
self.mox = mox.Mox()
def tearDown(self):
diff --git a/project/test/redirects_test.py b/project/test/redirects_test.py
index 0091571..1f71435 100644
--- a/project/test/redirects_test.py
+++ b/project/test/redirects_test.py
@@ -1,7 +1,6 @@
-# Copyright 2016 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 2016 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 project handlers that redirect."""
from __future__ import print_function
@@ -11,7 +10,7 @@
from six.moves import http_client
import unittest
-import webapp2
+import flask
from framework import urls
from project import redirects
@@ -24,9 +23,8 @@
def setUp(self):
self.services = service_manager.Services()
- self.servlet = redirects.WikiRedirect(
- webapp2.Request.blank('url'), webapp2.Response(),
- services=self.services)
+ self.servlet = redirects.WikiRedirect(services=self.services)
+ self.servlet.response = flask.Response()
self.project = fake.Project()
self.servlet.mr = testing_helpers.MakeMonorailRequest(
project=self.project)
@@ -58,9 +56,8 @@
def setUp(self):
self.services = service_manager.Services()
- self.servlet = redirects.SourceRedirect(
- webapp2.Request.blank('url'), webapp2.Response(),
- services=self.services)
+ self.servlet = redirects.SourceRedirect(services=self.services)
+ self.servlet.response = flask.Response()
self.project = fake.Project()
self.servlet.mr = testing_helpers.MakeMonorailRequest(
project=self.project)