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

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

Issue 2093593002: luci-py: Making __file__ usage unicode safe. (Closed) Base URL: https://github.com/luci/luci-py.git@master
Patch Set: Small fixes. Created 4 years, 5 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/trace_inputs/touch_only.py ('k') | client/tests/trace_inputs_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 # coding=utf-8 2 # coding=utf-8
3 # Copyright 2012 The LUCI Authors. All rights reserved. 3 # Copyright 2012 The LUCI Authors. All rights reserved.
4 # Use of this source code is governed under the Apache License, Version 2.0 4 # Use of this source code is governed under the Apache License, Version 2.0
5 # that can be found in the LICENSE file. 5 # that can be found in the LICENSE file.
6 6
7 import functools 7 import functools
8 import json 8 import json
9 import logging 9 import logging
10 import os 10 import os
11 import shutil 11 import shutil
12 import subprocess 12 import subprocess
13 import sys 13 import sys
14 import tempfile 14 import tempfile
15 import unicodedata 15 import unicodedata
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(
19 __file__.decode(sys.getfilesystemencoding()))))
19 sys.path.insert(0, ROOT_DIR) 20 sys.path.insert(0, ROOT_DIR)
20 21
21 import trace_inputs 22 import trace_inputs
22 from third_party.depot_tools import fix_encoding 23 from third_party.depot_tools import fix_encoding
23 from utils import file_path 24 from utils import file_path
24 from utils import threading_utils 25 from utils import threading_utils
25 26
26 27
27 FILENAME = os.path.basename(__file__) 28 FILENAME = os.path.basename(__file__.decode(sys.getfilesystemencoding()))
28 REL_DATA = os.path.join(u'tests', 'trace_inputs') 29 REL_DATA = os.path.join(u'tests', 'trace_inputs')
29 VERBOSE = False 30 VERBOSE = False
30 31
31 # TODO(maruel): Have the kernel tracer on Windows differentiate between file 32 # TODO(maruel): Have the kernel tracer on Windows differentiate between file
32 # read or file write. 33 # read or file write.
33 MODE_R = trace_inputs.Results.File.READ if sys.platform != 'win32' else None 34 MODE_R = trace_inputs.Results.File.READ if sys.platform != 'win32' else None
34 MODE_W = trace_inputs.Results.File.WRITE if sys.platform != 'win32' else None 35 MODE_W = trace_inputs.Results.File.WRITE if sys.platform != 'win32' else None
35 MODE_T = trace_inputs.Results.File.TOUCHED 36 MODE_T = trace_inputs.Results.File.TOUCHED
36 37
37 38
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 VERBOSE = '-v' in sys.argv 728 VERBOSE = '-v' in sys.argv
728 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR) 729 logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR)
729 if VERBOSE: 730 if VERBOSE:
730 unittest.TestCase.maxDiff = None 731 unittest.TestCase.maxDiff = None
731 # Necessary for the dtrace logger to work around execve() hook. See 732 # Necessary for the dtrace logger to work around execve() hook. See
732 # trace_inputs.py for more details. 733 # trace_inputs.py for more details.
733 os.environ['TRACE_INPUTS_DTRACE_ENABLE_EXECVE'] = '1' 734 os.environ['TRACE_INPUTS_DTRACE_ENABLE_EXECVE'] = '1'
734 print >> sys.stderr, 'Test are currently disabled' 735 print >> sys.stderr, 'Test are currently disabled'
735 sys.exit(0) 736 sys.exit(0)
736 #unittest.main() 737 #unittest.main()
OLDNEW
« no previous file with comments | « client/tests/trace_inputs/touch_only.py ('k') | client/tests/trace_inputs_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698