Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1950)

Unified Diff: appengine/monorail/project/test/projectupdates_test.py

Issue 1868553004: Open Source Monorail (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/monorail/project/test/projectsummary_test.py ('k') | appengine/monorail/project/wikiredirect.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/monorail/project/test/projectupdates_test.py
diff --git a/appengine/monorail/project/test/projectupdates_test.py b/appengine/monorail/project/test/projectupdates_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..42f1d1d6eac7ba5a8ff7f071658a31d11cbc8337
--- /dev/null
+++ b/appengine/monorail/project/test/projectupdates_test.py
@@ -0,0 +1,55 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is govered by a BSD-style
+# license that can be found in the LICENSE file or at
+# https://developers.google.com/open-source/licenses/bsd
+
+"""Unittests for monorail.project.projectupdates."""
+
+import unittest
+
+import mox
+
+from features import activities
+from project import projectupdates
+from services import service_manager
+from testing import fake
+from testing import testing_helpers
+
+
+class ProjectUpdatesTest(unittest.TestCase):
+
+ def setUp(self):
+ self.services = service_manager.Services(project=fake.ProjectService())
+
+ self.project_name = 'proj'
+ self.project_id = 987
+ self.project = self.services.project.TestAddProject(
+ self.project_name, project_id=self.project_id,
+ process_inbound_email=True)
+
+ 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.mox = mox.Mox()
+
+ def tearDown(self):
+ self.mox.UnsetStubs()
+ self.mox.ResetAll()
+
+ def testGatherPageData(self):
+ self.mox.StubOutWithMock(activities, 'GatherUpdatesData')
+ activities.GatherUpdatesData(
+ self.services, self.mr, mox.IgnoreArg(), project_ids=[self.project_id],
+ ending='by_user',
+ updates_page_url='/p/%s/updates/list' % self.project_name,
+ autolink=self.services.autolink).AndReturn({'test': 'testing'})
+ self.mox.ReplayAll()
+
+ page_data = self.project_updates.GatherPageData(self.mr)
+ self.mox.VerifyAll()
+ self.assertEquals(
+ {'subtab_mode': None, 'user_updates_tab_mode': None, 'test': 'testing'},
+ page_data)
+
« no previous file with comments | « appengine/monorail/project/test/projectsummary_test.py ('k') | appengine/monorail/project/wikiredirect.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698