| 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 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 Loading... |
| 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: |
| OLD | NEW |