Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The LUCI Authors. All rights reserved. | 1 # Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed under the Apache License, Version 2.0 | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # that can be found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Launches the repo bundler.""" | 5 """Launches the repo bundler.""" |
| 6 | 6 |
| 7 DEPS = [ | 7 DEPS = [ |
| 8 'path', | |
| 8 'python', | 9 'python', |
| 9 'raw_io', | 10 'raw_io', |
| 10 'step', | 11 'step', |
| 11 ] | 12 ] |
| 12 | 13 |
| 13 | 14 |
| 14 def RunSteps(api): | 15 def RunSteps(api): |
| 15 api.python.succeeding_step("success", ["This step is a success"], | 16 api.python.succeeding_step("success", ["This step is a success"], |
| 16 as_log='success') | 17 as_log='success') |
| 17 | 18 |
| 18 # Test that a failing step raises StepFailure. | 19 # Test that a failing step raises StepFailure. |
| 19 was_failure = False | 20 was_failure = False |
| 20 try: | 21 try: |
| 21 api.python.failing_step("failure", "This step is a failure :(") | 22 api.python.failing_step("failure", "This step is a failure :(") |
| 22 except api.step.StepFailure: | 23 except api.step.StepFailure: |
| 23 was_failure = True | 24 was_failure = True |
| 24 assert was_failure | 25 assert was_failure |
| 25 | 26 |
| 26 # Test that unbufferred actually removes PYTHONUNBUFFERED envvar. | 27 # Test that unbufferred actually removes PYTHONUNBUFFERED envvar. |
| 27 api.python('run json.tool', '-m', [ | 28 api.python('run json.tool', '-m', [ |
| 28 'json.tool', api.raw_io.input('{"something":[true,true]}'), | 29 'json.tool', api.raw_io.input('{"something":[true,true]}'), |
| 29 ], unbuffered=False) | 30 ], unbuffered=False) |
| 30 | 31 |
| 31 api.python.inline('inline', 'print "Hello World!"') | 32 api.python.inline('inline', 'print "Hello World!"') |
| 32 | 33 |
| 34 # Test "vpython"-based invocation. | |
| 35 api.python('run vpython.script', api.resource('test.py'), venv=True) | |
|
iannucci
2017/05/10 22:46:14
let's do test_embedded.py and test_external.py
| |
| 36 api.python('run vpython.spec', api.resource('test.py'), args=['--verify'], | |
| 37 venv=api.resource('test.vpython')) | |
| 38 | |
| 33 | 39 |
| 34 def GenTests(api): | 40 def GenTests(api): |
| 35 yield api.test('basic') | 41 yield api.test('basic') |
| OLD | NEW |