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