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

Unified Diff: client/tests/zip_package_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/tests/trace_inputs_smoke_test.py ('k') | client/tools/run_on_bots.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/tests/zip_package_test.py
diff --git a/client/tests/zip_package_test.py b/client/tests/zip_package_test.py
index 0c40439655dae89085290287b6d0ba99a19b7df7..c1f86e3e15205fdb3ad6fca28367be629fd92005 100755
--- a/client/tests/zip_package_test.py
+++ b/client/tests/zip_package_test.py
@@ -6,7 +6,6 @@
import cStringIO as StringIO
import logging
import os
-import shutil
import subprocess
import sys
import tempfile
@@ -16,6 +15,8 @@ import zipfile
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, ROOT_DIR)
+from third_party.depot_tools import fix_encoding
+from utils import file_path
from utils import zip_package
@@ -29,8 +30,10 @@ class ZipPackageTest(unittest.TestCase):
self.temp_dir = tempfile.mkdtemp(prefix=u'zip_package_test')
def tearDown(self):
- shutil.rmtree(self.temp_dir)
- super(ZipPackageTest, self).tearDown()
+ try:
+ file_path.rmtree(self.temp_dir)
+ finally:
+ super(ZipPackageTest, self).tearDown()
def stage_files(self, files):
"""Populates temp directory with given files specified as a list or dict."""
@@ -282,6 +285,7 @@ class ZipPackageTest(unittest.TestCase):
if __name__ == '__main__':
+ fix_encoding.fix_encoding()
VERBOSE = '-v' in sys.argv
logging.basicConfig(level=logging.DEBUG if VERBOSE else logging.ERROR)
unittest.main()
« no previous file with comments | « client/tests/trace_inputs_smoke_test.py ('k') | client/tools/run_on_bots.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698