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

Side by Side Diff: tests/scm_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/rietveld_test.py ('k') | tests/super_mox.py » ('j') | 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 scm.py.""" 6 """Unit tests for scm.py."""
7 7
8 from __future__ import with_statement 8 from __future__ import with_statement
9 import logging 9 import logging
10 import os 10 import os
11 import sys 11 import sys
12 import unittest 12 import unittest
13 13
14 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 14 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
15 15
16 from super_mox import SuperMoxTestBase 16 from testing_support import fake_repos
17 from testing_support.super_mox import SuperMoxTestBase
17 18
18 import fake_repos
19 import scm 19 import scm
20 import subprocess2 20 import subprocess2
21 21
22 22
23 class BaseTestCase(SuperMoxTestBase): 23 class BaseTestCase(SuperMoxTestBase):
24 # Like unittest's assertRaises, but checks for Gclient.Error. 24 # Like unittest's assertRaises, but checks for Gclient.Error.
25 def assertRaisesError(self, msg, fn, *args, **kwargs): 25 def assertRaisesError(self, msg, fn, *args, **kwargs):
26 try: 26 try:
27 fn(*args, **kwargs) 27 fn(*args, **kwargs)
28 except scm.gclient_utils.Error, e: 28 except scm.gclient_utils.Error, e:
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 # Asserting the tree is not sufficient, svn status must come out clear too. 337 # Asserting the tree is not sufficient, svn status must come out clear too.
338 self.assertEquals('', self._capture(['status'])) 338 self.assertEquals('', self._capture(['status']))
339 339
340 340
341 if __name__ == '__main__': 341 if __name__ == '__main__':
342 if '-v' in sys.argv: 342 if '-v' in sys.argv:
343 logging.basicConfig(level=logging.DEBUG) 343 logging.basicConfig(level=logging.DEBUG)
344 unittest.main() 344 unittest.main()
345 345
346 # vim: ts=2:sw=2:tw=80:et: 346 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « tests/rietveld_test.py ('k') | tests/super_mox.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698