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

Side by Side Diff: tests/gclient_utils_test.py

Issue 8508017: Standardize the sys.path fix up and fix a few pylint warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Previous patchset was broken Created 9 years, 1 month 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 | « tests/gclient_test.py ('k') | tests/owners_unittest.py » ('j') | 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) 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 # pylint: disable=E1101,W0403
7
8 import os 6 import os
9 import StringIO 7 import StringIO
8 import sys
10 9
11 # Fixes include path. 10 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
11
12 from super_mox import SuperMoxTestBase 12 from super_mox import SuperMoxTestBase
13 import trial_dir 13 import trial_dir
14 14
15 import gclient_utils 15 import gclient_utils
16 import subprocess2 16 import subprocess2
17 17
18 18
19 class GclientUtilBase(SuperMoxTestBase): 19 class GclientUtilBase(SuperMoxTestBase):
20 def setUp(self): 20 def setUp(self):
21 super(GclientUtilBase, self).setUp() 21 super(GclientUtilBase, self).setUp()
(...skipping 28 matching lines...) Expand all
50 self.stdout = StringIO.StringIO(test_string) 50 self.stdout = StringIO.StringIO(test_string)
51 def wait(self): 51 def wait(self):
52 pass 52 pass
53 53
54 def _inner(self, args, test_string): 54 def _inner(self, args, test_string):
55 cwd = 'bleh' 55 cwd = 'bleh'
56 gclient_utils.sys.stdout.write( 56 gclient_utils.sys.stdout.write(
57 '\n________ running \'boo foo bar\' in \'bleh\'\n') 57 '\n________ running \'boo foo bar\' in \'bleh\'\n')
58 for i in test_string: 58 for i in test_string:
59 gclient_utils.sys.stdout.write(i) 59 gclient_utils.sys.stdout.write(i)
60 # pylint: disable=E1101
60 subprocess2.Popen( 61 subprocess2.Popen(
61 args, 62 args,
62 cwd=cwd, 63 cwd=cwd,
63 stdout=subprocess2.PIPE, 64 stdout=subprocess2.PIPE,
64 stderr=subprocess2.STDOUT, 65 stderr=subprocess2.STDOUT,
65 bufsize=0).AndReturn(self.ProcessIdMock(test_string)) 66 bufsize=0).AndReturn(self.ProcessIdMock(test_string))
66 67
67 self.mox.ReplayAll() 68 self.mox.ReplayAll()
68 compiled_pattern = gclient_utils.re.compile(r'a(.*)b') 69 compiled_pattern = gclient_utils.re.compile(r'a(.*)b')
69 line_list = [] 70 line_list = []
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 os.chmod(l3, 0) 169 os.chmod(l3, 0)
169 os.chmod(l2, 0) 170 os.chmod(l2, 0)
170 os.chmod(l1, 0) 171 os.chmod(l1, 0)
171 172
172 173
173 if __name__ == '__main__': 174 if __name__ == '__main__':
174 import unittest 175 import unittest
175 unittest.main() 176 unittest.main()
176 177
177 # vim: ts=2:sw=2:tw=80:et: 178 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « tests/gclient_test.py ('k') | tests/owners_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698