| # 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 RepoTestApi(recipe_test_api.RecipeTestApi): |
| def snapshot(self, step_name, projects): |
| ret = self.step_data( |
| "%s.repo list" % step_name, |
| stdout=self.m.raw_io.output_text( |
| "\n".join(["%s : %s" % (p, p) for p in projects]) |
| ), |
| ) |
| for p in projects: |
| ret += self.step_data( |
| "%s.get %s HEAD" % (step_name, p), |
| stdout=self.m.raw_io.output_text("foo"), |
| ) |
| return ret |