Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: tests/gclient_test.py

Issue 228793002: gclient: Fix cache_dir functionality (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Replace path separator for Windows case Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gclient_scm.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 27 matching lines...) Expand all
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 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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()
OLDNEW
« no previous file with comments | « gclient_scm.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698