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 30 matching lines...) Expand all Loading... |
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 | 47 # pylint: disable=R0201 |
48 def DoesRemoteURLMatch(self, _): | 48 def DoesRemoteURLMatch(self, _): |
49 return True | 49 return True |
50 | 50 |
51 def GetActualRemoteURL(self): | 51 def GetActualRemoteURL(self, _): |
52 return self.url | 52 return self.url |
53 | 53 |
54 | 54 |
55 class GclientTest(trial_dir.TestCase): | 55 class GclientTest(trial_dir.TestCase): |
56 def setUp(self): | 56 def setUp(self): |
57 super(GclientTest, self).setUp() | 57 super(GclientTest, self).setUp() |
58 self.processed = Queue.Queue() | 58 self.processed = Queue.Queue() |
59 self.previous_dir = os.getcwd() | 59 self.previous_dir = os.getcwd() |
60 os.chdir(self.root_dir) | 60 os.chdir(self.root_dir) |
61 # Manual mocks. | 61 # Manual mocks. |
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) | 874 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) |
875 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True) | 875 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True) |
876 sys.stderr = gclient_utils.MakeFileAutoFlush(sys.stderr) | 876 sys.stderr = gclient_utils.MakeFileAutoFlush(sys.stderr) |
877 sys.stderr = gclient_utils.MakeFileAnnotated(sys.stderr, include_zero=True) | 877 sys.stderr = gclient_utils.MakeFileAnnotated(sys.stderr, include_zero=True) |
878 logging.basicConfig( | 878 logging.basicConfig( |
879 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ | 879 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ |
880 min(sys.argv.count('-v'), 3)], | 880 min(sys.argv.count('-v'), 3)], |
881 format='%(relativeCreated)4d %(levelname)5s %(module)13s(' | 881 format='%(relativeCreated)4d %(levelname)5s %(module)13s(' |
882 '%(lineno)d) %(message)s') | 882 '%(lineno)d) %(message)s') |
883 unittest.main() | 883 unittest.main() |
OLD | NEW |