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 gclient_scm.py.""" | 6 """Unit tests for gclient_scm.py.""" |
7 | 7 |
8 # pylint: disable=E1103 | 8 # pylint: disable=E1103 |
9 | 9 |
10 # Import before super_mox to keep valid references. | 10 # Import before super_mox to keep valid references. |
11 from os import rename | 11 from os import rename |
12 from shutil import rmtree | 12 from shutil import rmtree |
13 from subprocess import Popen, PIPE, STDOUT | 13 from subprocess import Popen, PIPE, STDOUT |
14 | 14 |
15 import logging | 15 import logging |
16 import os | 16 import os |
17 import sys | 17 import sys |
18 import tempfile | 18 import tempfile |
19 import unittest | 19 import unittest |
20 import __builtin__ | 20 import __builtin__ |
21 | 21 |
22 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | 22 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
23 | 23 |
24 from super_mox import mox, StdoutCheck, SuperMoxTestBase | 24 from testing_support.super_mox import mox, StdoutCheck, SuperMoxTestBase |
25 from super_mox import TestCaseUtils | 25 from testing_support.super_mox import TestCaseUtils |
26 | 26 |
27 import gclient_scm | 27 import gclient_scm |
28 import subprocess2 | 28 import subprocess2 |
29 | 29 |
30 # Shortcut since this function is used often | 30 # Shortcut since this function is used often |
31 join = gclient_scm.os.path.join | 31 join = gclient_scm.os.path.join |
32 | 32 |
33 | 33 |
34 class GCBaseTestCase(object): | 34 class GCBaseTestCase(object): |
35 def assertRaisesError(self, msg, fn, *args, **kwargs): | 35 def assertRaisesError(self, msg, fn, *args, **kwargs): |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 | 966 |
967 if __name__ == '__main__': | 967 if __name__ == '__main__': |
968 if '-v' in sys.argv: | 968 if '-v' in sys.argv: |
969 logging.basicConfig( | 969 logging.basicConfig( |
970 level=logging.DEBUG, | 970 level=logging.DEBUG, |
971 format='%(asctime).19s %(levelname)s %(filename)s:' | 971 format='%(asctime).19s %(levelname)s %(filename)s:' |
972 '%(lineno)s %(message)s') | 972 '%(lineno)s %(message)s') |
973 unittest.main() | 973 unittest.main() |
974 | 974 |
975 # vim: ts=2:sw=2:tw=80:et: | 975 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |