Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style |
| 3 | # license that can be found in the LICENSE file or at |
| 4 | # https://developers.google.com/open-source/licenses/bsd |
| 5 | |
| 6 | """Tests for issuetips module.""" |
| 7 | from __future__ import print_function |
| 8 | from __future__ import division |
| 9 | from __future__ import absolute_import |
| 10 | |
| 11 | import unittest |
| 12 | |
| 13 | from services import service_manager |
| 14 | from testing import fake |
| 15 | from testing import testing_helpers |
| 16 | from tracker import issuetips |
| 17 | |
| 18 | |
| 19 | class IssueTipsTest(unittest.TestCase): |
| 20 | |
| 21 | def setUp(self): |
| 22 | self.services = service_manager.Services( |
| 23 | config=fake.ConfigService(), |
| 24 | issue=fake.IssueService(), |
| 25 | user=fake.UserService(), |
| 26 | project=fake.ProjectService()) |
| 27 | self.servlet = issuetips.IssueSearchTips( |
| 28 | 'req', 'res', services=self.services) |
| 29 | |
| 30 | def testGatherPageData(self): |
| 31 | mr = testing_helpers.MakeMonorailRequest(path='/p/proj/issues/tips') |
| 32 | page_data = self.servlet.GatherPageData(mr) |
| 33 | self.assertEqual('issueSearchTips', page_data['issue_tab_mode']) |