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

Unified Diff: appengine/swarming/server/bot_code_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 | « appengine/swarming/remote_smoke_test.py ('k') | appengine/swarming/swarming_bot/bot_code/bot_main_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/server/bot_code_test.py
diff --git a/appengine/swarming/server/bot_code_test.py b/appengine/swarming/server/bot_code_test.py
index ee9c888fa32cce685ea99cdfcdfc79caf6036422..34f54ccc7e73e238909084b74f1b802563b8594e 100755
--- a/appengine/swarming/server/bot_code_test.py
+++ b/appengine/swarming/server/bot_code_test.py
@@ -7,7 +7,6 @@ import StringIO
import logging
import os
import re
-import shutil
import subprocess
import sys
import tempfile
@@ -23,6 +22,13 @@ from test_support import test_case
from server import bot_archive
from server import bot_code
+CLIENT_DIR = os.path.join(
+ os.path.dirname(os.path.dirname(test_env.APP_DIR)), 'client')
+sys.path.insert(0, CLIENT_DIR)
+from third_party.depot_tools import fix_encoding
+from utils import file_path
+sys.path.pop(0)
+
class BotManagementTest(test_case.TestCase):
def setUp(self):
@@ -73,10 +79,11 @@ class BotManagementTest(test_case.TestCase):
out = proc.communicate()[0]
self.assertEqual(0, proc.returncode, out)
finally:
- shutil.rmtree(temp_dir)
+ file_path.rmtree(temp_dir)
if __name__ == '__main__':
+ fix_encoding.fix_encoding()
logging.basicConfig(
level=logging.DEBUG if '-v' in sys.argv else logging.ERROR)
unittest.main()
« no previous file with comments | « appengine/swarming/remote_smoke_test.py ('k') | appengine/swarming/swarming_bot/bot_code/bot_main_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698