| # Copyright 2022 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 CIPDUtilTestApi(recipe_test_api.RecipeTestApi): |
| def get_platforms(self, step_name, platforms): |
| return self.step_data( |
| f"{step_name}.read ensure file", |
| self.m.file.read_text( |
| f"$VerifiedPlatform {' '.join(p for p in platforms)}" |
| if platforms |
| else "" |
| ), |
| ) |
| |
| def update_packages(self, step_name, packages): |
| return self.step_data( |
| f"{step_name}.read ensure file", |
| self.m.file.read_text("\n".join([f"{p} version:old" for p in packages])), |
| ) |