| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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. | 8 # pylint: disable=E1103,E1120,W0212 |
| 9 # pylint: disable=E1103,E1120,W0212,W0403 | 9 |
| 10 import os |
| 11 import sys |
| 12 |
| 13 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
| 10 | 14 |
| 11 import super_mox | 15 import super_mox |
| 12 import watchlists | 16 import watchlists |
| 13 | 17 |
| 14 | 18 |
| 15 class WatchlistsTest(super_mox.SuperMoxTestBase): | 19 class WatchlistsTest(super_mox.SuperMoxTestBase): |
| 16 | 20 |
| 17 def setUp(self): | 21 def setUp(self): |
| 18 super_mox.SuperMoxTestBase.setUp(self) | 22 super_mox.SuperMoxTestBase.setUp(self) |
| 19 self.mox.StubOutWithMock(watchlists.Watchlists, '_HasWatchlistsFile') | 23 self.mox.StubOutWithMock(watchlists.Watchlists, '_HasWatchlistsFile') |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 wl = watchlists.Watchlists(r'a\path') | 156 wl = watchlists.Watchlists(r'a\path') |
| 153 returned_watchers = wl.GetWatchersForPaths( | 157 returned_watchers = wl.GetWatchersForPaths( |
| 154 [r'chrome\browser\renderer_host\render_widget_host.h']) | 158 [r'chrome\browser\renderer_host\render_widget_host.h']) |
| 155 watchlists.os.sep = saved_sep # revert back os.sep before asserts | 159 watchlists.os.sep = saved_sep # revert back os.sep before asserts |
| 156 self.assertEqual(returned_watchers, watchers) | 160 self.assertEqual(returned_watchers, watchers) |
| 157 | 161 |
| 158 | 162 |
| 159 if __name__ == '__main__': | 163 if __name__ == '__main__': |
| 160 import unittest | 164 import unittest |
| 161 unittest.main() | 165 unittest.main() |
| OLD | NEW |