| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Unit tests for watchlists.py.""" | 6 """Unit tests for watchlists.py.""" |
| 7 | 7 |
| 8 # pylint is too confused. |
| 9 # pylint: disable=E1103,E1120,W0212,W0403 |
| 10 |
| 8 import super_mox | 11 import super_mox |
| 9 import watchlists | 12 import watchlists |
| 10 | 13 |
| 11 | 14 |
| 12 class WatchlistsTest(super_mox.SuperMoxTestBase): | 15 class WatchlistsTest(super_mox.SuperMoxTestBase): |
| 13 | 16 |
| 14 def setUp(self): | 17 def setUp(self): |
| 15 super_mox.SuperMoxTestBase.setUp(self) | 18 super_mox.SuperMoxTestBase.setUp(self) |
| 16 self.mox.StubOutWithMock(watchlists.Watchlists, '_HasWatchlistsFile') | 19 self.mox.StubOutWithMock(watchlists.Watchlists, '_HasWatchlistsFile') |
| 17 self.mox.StubOutWithMock(watchlists.Watchlists, '_ContentsOfWatchlistsFile') | 20 self.mox.StubOutWithMock(watchlists.Watchlists, '_ContentsOfWatchlistsFile') |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 wl = watchlists.Watchlists(r'a\path') | 152 wl = watchlists.Watchlists(r'a\path') |
| 150 returned_watchers = wl.GetWatchersForPaths( | 153 returned_watchers = wl.GetWatchersForPaths( |
| 151 [r'chrome\browser\renderer_host\render_widget_host.h']) | 154 [r'chrome\browser\renderer_host\render_widget_host.h']) |
| 152 watchlists.os.sep = saved_sep # revert back os.sep before asserts | 155 watchlists.os.sep = saved_sep # revert back os.sep before asserts |
| 153 self.assertEqual(returned_watchers, watchers) | 156 self.assertEqual(returned_watchers, watchers) |
| 154 | 157 |
| 155 | 158 |
| 156 if __name__ == '__main__': | 159 if __name__ == '__main__': |
| 157 import unittest | 160 import unittest |
| 158 unittest.main() | 161 unittest.main() |
| OLD | NEW |