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

Unified Diff: appengine/monorail/tracker/test/issuelistcsv_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
Index: appengine/monorail/tracker/test/issuelistcsv_test.py
diff --git a/appengine/monorail/tracker/test/issuelistcsv_test.py b/appengine/monorail/tracker/test/issuelistcsv_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..94062bc065633790eb84243b2e07d34fefbd1151
--- /dev/null
+++ b/appengine/monorail/tracker/test/issuelistcsv_test.py
@@ -0,0 +1,44 @@
+# 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
+
+"""Unit tests for issuelistcsv module."""
+
+import unittest
+
+from framework import permissions
+from services import service_manager
+from testing import testing_helpers
+from tracker import issuelistcsv
+
+
+class IssueListCSVTest(unittest.TestCase):
+
+ def setUp(self):
+ self.services = service_manager.Services()
+ self.servlet = issuelistcsv.IssueListCsv(
+ 'req', 'res', services=self.services)
+
+ def testRewriteColspec(self):
+ self.assertEqual('', issuelistcsv._RewriteColspec(''))
+
+ self.assertEqual('a B c', issuelistcsv._RewriteColspec('a B c'))
+
+ self.assertEqual('a Summary AllLabels B Opened OpenedTimestamp c',
+ issuelistcsv._RewriteColspec('a summary B opened c'))
+
+ self.assertEqual('Closed ClosedTimestamp Modified ModifiedTimestamp',
+ issuelistcsv._RewriteColspec('Closed Modified'))
+
+
+ def testGatherPageData_AnonUsers(self):
+ """Anonymous users cannot download the issue list."""
+ mr = testing_helpers.MakeMonorailRequest()
+ mr.auth.user_id = 0
+ self.assertRaises(permissions.PermissionException,
+ self.servlet.GatherPageData, mr)
+
+
+if __name__ == '__main__':
+ unittest.main()
« no previous file with comments | « appengine/monorail/tracker/test/issuelist_test.py ('k') | appengine/monorail/tracker/test/issueoptions_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698