| # Copyright 2021 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| from recipe_engine import recipe_test_api |
| |
| |
| class ReleaseTestApi(recipe_test_api.RecipeTestApi): |
| def ref_to_release_version(self, test_data, nesting=None, rep=None, retcode=None): |
| step_name = "ref to release version" |
| if nesting: |
| step_name = "%s.%s" % (nesting, step_name) |
| if rep: |
| step_name += " (%d)" % rep |
| return self.step_data( |
| step_name, self.m.raw_io.stream_output_text(test_data), retcode=retcode |
| ) |
| |
| def get_branches(self, branches, remotes=False, nesting=None): |
| step_name = "get branches" |
| if nesting: |
| step_name = "%s.%s" % (nesting, step_name) |
| return self.m.git.branch(step_name, branches, remotes=remotes) |
| |
| def get_major_number(self, number, nesting=None): |
| step_name = "get major number" |
| if nesting: |
| step_name = "%s.%s" % (nesting, step_name) |
| return self.step_data(step_name, self.m.file.read_text(str(number))) |