OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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.py. | 6 """Unit tests for gclient.py. |
7 | 7 |
8 See gclient_smoketest.py for integration tests. | 8 See gclient_smoketest.py for integration tests. |
9 """ | 9 """ |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 sys.stdout = gclient.gclient_utils.MakeFileAutoFlush(sys.stdout) | 65 sys.stdout = gclient.gclient_utils.MakeFileAutoFlush(sys.stdout) |
66 sys.stdout = gclient.gclient_utils.MakeFileAnnotated(sys.stdout) | 66 sys.stdout = gclient.gclient_utils.MakeFileAnnotated(sys.stdout) |
67 | 67 |
68 def tearDown(self): | 68 def tearDown(self): |
69 self.assertEquals([], self._get_processed()) | 69 self.assertEquals([], self._get_processed()) |
70 gclient.gclient_scm.CreateSCM = self._old_createscm | 70 gclient.gclient_scm.CreateSCM = self._old_createscm |
71 sys.stdout = self._old_sys_stdout | 71 sys.stdout = self._old_sys_stdout |
72 os.chdir(self.previous_dir) | 72 os.chdir(self.previous_dir) |
73 super(GclientTest, self).tearDown() | 73 super(GclientTest, self).tearDown() |
74 | 74 |
75 def _createscm(self, parsed_url, root_dir, name): | 75 def _createscm(self, parsed_url, root_dir, name, out_fh=None, out_cb=None): |
76 self.assertTrue(parsed_url.startswith('svn://example.com/'), parsed_url) | 76 self.assertTrue(parsed_url.startswith('svn://example.com/'), parsed_url) |
77 self.assertTrue(root_dir.startswith(self.root_dir), root_dir) | 77 self.assertTrue(root_dir.startswith(self.root_dir), root_dir) |
78 return SCMMock(self, parsed_url) | 78 return SCMMock(self, parsed_url) |
79 | 79 |
80 def testDependencies(self): | 80 def testDependencies(self): |
81 self._dependencies('1') | 81 self._dependencies('1') |
82 | 82 |
83 def testDependenciesJobs(self): | 83 def testDependenciesJobs(self): |
84 self._dependencies('1000') | 84 self._dependencies('1000') |
85 | 85 |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) | 656 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) |
657 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True) | 657 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True) |
658 sys.stderr = gclient_utils.MakeFileAutoFlush(sys.stderr) | 658 sys.stderr = gclient_utils.MakeFileAutoFlush(sys.stderr) |
659 sys.stderr = gclient_utils.MakeFileAnnotated(sys.stderr, include_zero=True) | 659 sys.stderr = gclient_utils.MakeFileAnnotated(sys.stderr, include_zero=True) |
660 logging.basicConfig( | 660 logging.basicConfig( |
661 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ | 661 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ |
662 min(sys.argv.count('-v'), 3)], | 662 min(sys.argv.count('-v'), 3)], |
663 format='%(relativeCreated)4d %(levelname)5s %(module)13s(' | 663 format='%(relativeCreated)4d %(levelname)5s %(module)13s(' |
664 '%(lineno)d) %(message)s') | 664 '%(lineno)d) %(message)s') |
665 unittest.main() | 665 unittest.main() |
OLD | NEW |