| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The LUCI Authors. All rights reserved. | 2 # Copyright 2014 The LUCI Authors. All rights reserved. |
| 3 # Use of this source code is governed under the Apache License, Version 2.0 | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
| 4 # that can be found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
| 5 | 5 |
| 6 import json | 6 import json |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | |
| 11 import unittest | 10 import unittest |
| 12 import tempfile | 11 import tempfile |
| 13 import time | 12 import time |
| 14 | 13 |
| 15 import test_env | 14 import test_env |
| 16 from test_env import BASE_DIR | 15 from test_env import BASE_DIR |
| 17 | 16 |
| 18 import recipe_engine.run | 17 import recipe_engine.run |
| 19 import recipe_engine.step_runner | 18 import recipe_engine.step_runner |
| 20 from recipe_engine import requests_ssl | 19 from recipe_engine import requests_ssl |
| 21 from recipe_engine import recipe_test_api | |
| 22 import mock | |
| 23 | 20 |
| 24 class RunTest(unittest.TestCase): | 21 class RunTest(unittest.TestCase): |
| 25 def _run_cmd(self, recipe, properties=None, engine_args=None): | 22 def _run_cmd(self, recipe, properties=None, engine_args=None): |
| 26 script_path = os.path.join(BASE_DIR, 'recipes.py') | 23 script_path = os.path.join(BASE_DIR, 'recipes.py') |
| 27 | 24 |
| 28 if properties: | 25 if properties: |
| 29 proplist = [ '%s=%s' % (k, json.dumps(v)) | 26 proplist = [ '%s=%s' % (k, json.dumps(v)) |
| 30 for k,v in properties.iteritems() ] | 27 for k,v in properties.iteritems() ] |
| 31 else: | 28 else: |
| 32 proplist = [] | 29 proplist = [] |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 self.assertRegexpMatches(stdout, r'(?m)^@@@BUILD_STEP@pippy@@@$') | 194 self.assertRegexpMatches(stdout, r'(?m)^@@@BUILD_STEP@pippy@@@$') |
| 198 # Before 'Subannotate me' we expect an extra STEP_CURSOR to reset the | 195 # Before 'Subannotate me' we expect an extra STEP_CURSOR to reset the |
| 199 # state. | 196 # state. |
| 200 self.assertRegexpMatches(stdout, | 197 self.assertRegexpMatches(stdout, |
| 201 r'(?m)^@@@STEP_CURSOR@Subannotate me@@@\n@@@STEP_CLOSED@@@$') | 198 r'(?m)^@@@STEP_CURSOR@Subannotate me@@@\n@@@STEP_CLOSED@@@$') |
| 202 | 199 |
| 203 | 200 |
| 204 if __name__ == '__main__': | 201 if __name__ == '__main__': |
| 205 unittest.TestCase.maxDiff = None | 202 unittest.TestCase.maxDiff = None |
| 206 unittest.main() | 203 unittest.main() |
| OLD | NEW |