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

Side by Side Diff: tests/fix_encoding_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/checkout_test.py ('k') | tests/gcl_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 # coding=utf8 2 # coding=utf8
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Unit tests for fix_encoding.py.""" 7 """Unit tests for fix_encoding.py."""
8 8
9 import os 9 import os
10 import sys 10 import sys
11 import unittest 11 import unittest
12 12
13 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 13 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
14 sys.path.insert(0, ROOT_DIR)
15 14
16 import fix_encoding 15 import fix_encoding
17 16
18 17
19 class FixEncodingTest(unittest.TestCase): 18 class FixEncodingTest(unittest.TestCase):
20 # Nice mix of latin, hebrew, arabic and chinese. Doesn't mean anything. 19 # Nice mix of latin, hebrew, arabic and chinese. Doesn't mean anything.
21 text = u'Héllô 偉大 سيد' 20 text = u'Héllô 偉大 سيد'
22 21
23 def test_code_page(self): 22 def test_code_page(self):
24 # Make sure printing garbage won't throw. 23 # Make sure printing garbage won't throw.
(...skipping 27 matching lines...) Expand all
52 self.assertEquals(sys.stderr.encoding, sys.getdefaultencoding()) 51 self.assertEquals(sys.stderr.encoding, sys.getdefaultencoding())
53 52
54 def test_multiple_calls(self): 53 def test_multiple_calls(self):
55 # Shouldn't do anything. 54 # Shouldn't do anything.
56 self.assertEquals(False, fix_encoding.fix_encoding()) 55 self.assertEquals(False, fix_encoding.fix_encoding())
57 56
58 57
59 if __name__ == '__main__': 58 if __name__ == '__main__':
60 assert fix_encoding.fix_encoding() 59 assert fix_encoding.fix_encoding()
61 unittest.main() 60 unittest.main()
OLDNEW
« no previous file with comments | « tests/checkout_test.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698