| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # coding=utf-8 | 2 # coding=utf-8 |
| 3 # Copyright 2013 The LUCI Authors. All rights reserved. | 3 # Copyright 2013 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 base64 | 7 import base64 |
| 8 import json | 8 import json |
| 9 import logging | 9 import logging |
| 10 import os | 10 import os |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 ' \'internal_failure\': None,\n' | 331 ' \'internal_failure\': None,\n' |
| 332 ' \'outputs_ref\': {\n' | 332 ' \'outputs_ref\': {\n' |
| 333 ' \'isolated\': \'123\',\n' | 333 ' \'isolated\': \'123\',\n' |
| 334 ' \'isolatedserver\': \'http://localhost:1\',\n' | 334 ' \'isolatedserver\': \'http://localhost:1\',\n' |
| 335 ' \'namespace\': \'default-gzip\',\n' | 335 ' \'namespace\': \'default-gzip\',\n' |
| 336 ' },\n' | 336 ' },\n' |
| 337 ' }, f)\n' | 337 ' }, f)\n' |
| 338 'sys.stdout.write(\'hi\\n\')') | 338 'sys.stdout.write(\'hi\\n\')') |
| 339 self.mock( | 339 self.mock( |
| 340 task_runner, 'get_isolated_cmd', | 340 task_runner, 'get_isolated_cmd', |
| 341 lambda _work_dir, _details, isolated_result, min_free_space, bot_file: | 341 lambda _work_dir, _details, isolated_result, bot_file, pkg_list, |
| 342 min_free_space: |
| 342 [sys.executable, '-u', '-c', SCRIPT_ISOLATED, isolated_result]) | 343 [sys.executable, '-u', '-c', SCRIPT_ISOLATED, isolated_result]) |
| 343 expected = { | 344 expected = { |
| 344 u'exit_code': 0, | 345 u'exit_code': 0, |
| 345 u'hard_timeout': False, | 346 u'hard_timeout': False, |
| 346 u'io_timeout': False, | 347 u'io_timeout': False, |
| 347 u'must_signal_internal_failure': None, | 348 u'must_signal_internal_failure': None, |
| 348 u'version': task_runner.OUT_VERSION, | 349 u'version': task_runner.OUT_VERSION, |
| 349 } | 350 } |
| 350 self.assertEqual(expected, self._run_command(task_details)) | 351 self.assertEqual(expected, self._run_command(task_details)) |
| 351 | 352 |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 fix_encoding.fix_encoding() | 1147 fix_encoding.fix_encoding() |
| 1147 if '-v' in sys.argv: | 1148 if '-v' in sys.argv: |
| 1148 unittest.TestCase.maxDiff = None | 1149 unittest.TestCase.maxDiff = None |
| 1149 logging_utils.prepare_logging(None) | 1150 logging_utils.prepare_logging(None) |
| 1150 logging_utils.set_console_level( | 1151 logging_utils.set_console_level( |
| 1151 logging.DEBUG if '-v' in sys.argv else logging.CRITICAL+1) | 1152 logging.DEBUG if '-v' in sys.argv else logging.CRITICAL+1) |
| 1152 # Fix litteral text expectation. | 1153 # Fix litteral text expectation. |
| 1153 os.environ['LANG'] = 'en_US.UTF-8' | 1154 os.environ['LANG'] = 'en_US.UTF-8' |
| 1154 os.environ['LANGUAGE'] = 'en_US.UTF-8' | 1155 os.environ['LANGUAGE'] = 'en_US.UTF-8' |
| 1155 unittest.main() | 1156 unittest.main() |
| OLD | NEW |