| 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 26 matching lines...) Expand all Loading... |
| 37 self.unit_test = unit_test | 37 self.unit_test = unit_test |
| 38 self.url = url | 38 self.url = url |
| 39 | 39 |
| 40 def RunCommand(self, command, options, args, file_list): | 40 def RunCommand(self, command, options, args, file_list): |
| 41 self.unit_test.assertEquals('None', command) | 41 self.unit_test.assertEquals('None', command) |
| 42 self.unit_test.processed.put(self.url) | 42 self.unit_test.processed.put(self.url) |
| 43 | 43 |
| 44 def FullUrlForRelativeUrl(self, url): | 44 def FullUrlForRelativeUrl(self, url): |
| 45 return self.url + url | 45 return self.url + url |
| 46 | 46 |
| 47 # pylint: disable=R0201 |
| 48 def DoesRemoteURLMatch(self): |
| 49 return True |
| 50 |
| 47 | 51 |
| 48 class GclientTest(trial_dir.TestCase): | 52 class GclientTest(trial_dir.TestCase): |
| 49 def setUp(self): | 53 def setUp(self): |
| 50 super(GclientTest, self).setUp() | 54 super(GclientTest, self).setUp() |
| 51 self.processed = Queue.Queue() | 55 self.processed = Queue.Queue() |
| 52 self.previous_dir = os.getcwd() | 56 self.previous_dir = os.getcwd() |
| 53 os.chdir(self.root_dir) | 57 os.chdir(self.root_dir) |
| 54 # Manual mocks. | 58 # Manual mocks. |
| 55 self._old_createscm = gclient.gclient_scm.CreateSCM | 59 self._old_createscm = gclient.gclient_scm.CreateSCM |
| 56 gclient.gclient_scm.CreateSCM = self._createscm | 60 gclient.gclient_scm.CreateSCM = self._createscm |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) | 653 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) |
| 650 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True) | 654 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True) |
| 651 sys.stderr = gclient_utils.MakeFileAutoFlush(sys.stderr) | 655 sys.stderr = gclient_utils.MakeFileAutoFlush(sys.stderr) |
| 652 sys.stderr = gclient_utils.MakeFileAnnotated(sys.stderr, include_zero=True) | 656 sys.stderr = gclient_utils.MakeFileAnnotated(sys.stderr, include_zero=True) |
| 653 logging.basicConfig( | 657 logging.basicConfig( |
| 654 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ | 658 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ |
| 655 min(sys.argv.count('-v'), 3)], | 659 min(sys.argv.count('-v'), 3)], |
| 656 format='%(relativeCreated)4d %(levelname)5s %(module)13s(' | 660 format='%(relativeCreated)4d %(levelname)5s %(module)13s(' |
| 657 '%(lineno)d) %(message)s') | 661 '%(lineno)d) %(message)s') |
| 658 unittest.main() | 662 unittest.main() |
| OLD | NEW |