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

Side by Side Diff: client/tests/isolate_smoke_test.py

Issue 1390773002: Add an assert to ensure UTF-8 locale when handling file paths. (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: More fixes Created 5 years, 2 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
« no previous file with comments | « client/tests/isolate_format_test.py ('k') | client/tests/isolate_test.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 2012 The Swarming Authors. All rights reserved. 2 # Copyright 2012 The Swarming Authors. All rights reserved.
3 # Use of this source code is governed under the Apache License, Version 2.0 that 3 # Use of this source code is governed under the Apache License, Version 2.0 that
4 # can be found in the LICENSE file. 4 # can be found in the LICENSE file.
5 5
6 import cStringIO 6 import cStringIO
7 import hashlib 7 import hashlib
8 import json 8 import json
9 import logging 9 import logging
10 import os 10 import os
11 import re 11 import re
12 import stat 12 import stat
13 import subprocess 13 import subprocess
14 import sys 14 import sys
15 import tempfile 15 import tempfile
16 import unittest 16 import unittest
17 17
18 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 18 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
19 sys.path.insert(0, ROOT_DIR) 19 sys.path.insert(0, ROOT_DIR)
20 20
21 import isolate 21 import isolate
22 import isolated_format 22 import isolated_format
23 from depot_tools import fix_encoding
23 from utils import file_path 24 from utils import file_path
24 25
25 import test_utils 26 import test_utils
26 27
27 28
28 ALGO = hashlib.sha1 29 ALGO = hashlib.sha1
29 HASH_NULL = ALGO().hexdigest() 30 HASH_NULL = ALGO().hexdigest()
30 31
31 32
32 # These are per test case, not per mode. 33 # These are per test case, not per mode.
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 subprocess.check_call(cmd + ['-i', a_isolate], cwd=ROOT_DIR) 1060 subprocess.check_call(cmd + ['-i', a_isolate], cwd=ROOT_DIR)
1060 1061
1061 # Move the .isolate file aside and rerun the command with the new source but 1062 # Move the .isolate file aside and rerun the command with the new source but
1062 # same destination. 1063 # same destination.
1063 b_isolate = os.path.join(self.tempdir, 'b.isolate') 1064 b_isolate = os.path.join(self.tempdir, 'b.isolate')
1064 os.rename(a_isolate, b_isolate) 1065 os.rename(a_isolate, b_isolate)
1065 subprocess.check_call(cmd + ['-i', b_isolate], cwd=ROOT_DIR) 1066 subprocess.check_call(cmd + ['-i', b_isolate], cwd=ROOT_DIR)
1066 1067
1067 1068
1068 if __name__ == '__main__': 1069 if __name__ == '__main__':
1070 fix_encoding.fix_encoding()
1069 test_utils.main() 1071 test_utils.main()
OLDNEW
« no previous file with comments | « client/tests/isolate_format_test.py ('k') | client/tests/isolate_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698