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

Side by Side Diff: tests/watchlists_unittest.py

Issue 8508015: Create a new depot_tools_testing_lib to move utility modules there (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Renamed to testing_support Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/trychange_unittest.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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: disable=E1103,E1120,W0212 8 # pylint: disable=E1103,E1120,W0212
9 9
10 import os 10 import os
11 import sys 11 import sys
12 12
13 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 13 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
14 14
15 import super_mox 15 from testing_support import super_mox
16
16 import watchlists 17 import watchlists
17 18
18 19
19 class WatchlistsTest(super_mox.SuperMoxTestBase): 20 class WatchlistsTest(super_mox.SuperMoxTestBase):
20 21
21 def setUp(self): 22 def setUp(self):
22 super_mox.SuperMoxTestBase.setUp(self) 23 super_mox.SuperMoxTestBase.setUp(self)
23 self.mox.StubOutWithMock(watchlists.Watchlists, '_HasWatchlistsFile') 24 self.mox.StubOutWithMock(watchlists.Watchlists, '_HasWatchlistsFile')
24 self.mox.StubOutWithMock(watchlists.Watchlists, '_ContentsOfWatchlistsFile') 25 self.mox.StubOutWithMock(watchlists.Watchlists, '_ContentsOfWatchlistsFile')
25 self.mox.StubOutWithMock(watchlists.logging, 'error') 26 self.mox.StubOutWithMock(watchlists.logging, 'error')
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 wl = watchlists.Watchlists(r'a\path') 157 wl = watchlists.Watchlists(r'a\path')
157 returned_watchers = wl.GetWatchersForPaths( 158 returned_watchers = wl.GetWatchersForPaths(
158 [r'chrome\browser\renderer_host\render_widget_host.h']) 159 [r'chrome\browser\renderer_host\render_widget_host.h'])
159 watchlists.os.sep = saved_sep # revert back os.sep before asserts 160 watchlists.os.sep = saved_sep # revert back os.sep before asserts
160 self.assertEqual(returned_watchers, watchers) 161 self.assertEqual(returned_watchers, watchers)
161 162
162 163
163 if __name__ == '__main__': 164 if __name__ == '__main__':
164 import unittest 165 import unittest
165 unittest.main() 166 unittest.main()
OLDNEW
« no previous file with comments | « tests/trychange_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698