| OLD | NEW |
| 1 # -*- coding: utf-8 -*- |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 4 | 5 |
| 5 from recipe_engine.config_types import Path | 6 from recipe_engine.config_types import Path |
| 6 | 7 |
| 7 | 8 |
| 8 DEPS = [ | 9 DEPS = [ |
| 9 'git_cl', | 10 'git_cl', |
| 10 'recipe_engine/path', | 11 'recipe_engine/path', |
| 11 'recipe_engine/raw_io', | 12 'recipe_engine/raw_io', |
| 12 'recipe_engine/step', | 13 'recipe_engine/step', |
| 13 ] | 14 ] |
| 14 | 15 |
| 15 | 16 |
| 16 def RunSteps(api): | 17 def RunSteps(api): |
| 18 api.git_cl.upload(u"Do the thing foobar\nNow with emoji: 😄") |
| 19 api.git_cl.issue() |
| 17 result = api.git_cl.get_description( | 20 result = api.git_cl.get_description( |
| 18 patch='https://code.review/123', codereview='rietveld', suffix='build') | 21 patch='https://code.review/123', codereview='rietveld', suffix='build') |
| 19 api.git_cl.set_description( | 22 api.git_cl.set_description( |
| 20 'bammmm', patch='https://code.review/123', codereview='rietveld') | 23 'bammmm', patch='https://code.review/123', codereview='rietveld') |
| 21 api.step('echo', ['echo', result.stdout]) | 24 api.step('echo', ['echo', result.stdout]) |
| 22 | 25 |
| 23 api.git_cl.set_config('basic') | 26 api.git_cl.set_config('basic') |
| 24 api.git_cl.c.repo_location = api.path.mkdtemp('fakerepo') | 27 api.git_cl.c.repo_location = api.path.mkdtemp('fakerepo') |
| 25 | 28 |
| 26 api.step('echo', ['echo', api.git_cl.get_description().stdout]) | 29 api.step('echo', ['echo', api.git_cl.get_description().stdout]) |
| 27 | 30 |
| 28 api.git_cl.set_description('new description woo') | 31 api.git_cl.set_description('new description woo') |
| 29 | 32 |
| 30 api.step('echo', ['echo', api.git_cl.get_description().stdout]) | 33 api.step('echo', ['echo', api.git_cl.get_description().stdout]) |
| 31 | 34 |
| 32 def GenTests(api): | 35 def GenTests(api): |
| 33 yield ( | 36 yield ( |
| 34 api.test('basic') + | 37 api.test('basic') + |
| 35 api.override_step_data( | 38 api.override_step_data( |
| 36 'git_cl description (build)', stdout=api.raw_io.output('hi')) + | 39 'git_cl description (build)', stdout=api.raw_io.output('hi')) + |
| 37 api.override_step_data( | 40 api.override_step_data( |
| 38 'git_cl description', stdout=api.raw_io.output('hey')) + | 41 'git_cl description', stdout=api.raw_io.output('hey')) + |
| 39 api.override_step_data( | 42 api.override_step_data( |
| 40 'git_cl description (2)', stdout=api.raw_io.output( | 43 'git_cl description (2)', stdout=api.raw_io.output( |
| 41 'new description woo')) | 44 'new description woo')) |
| 42 ) | 45 ) |
| 43 | 46 |
| OLD | NEW |