blob: 8a83a5f0e1b47466d92b41307bed34297342f018 [file] [log] [blame]
# Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
"""Test of label functionality of roll_util."""
DEPS = [
'fuchsia/status_check',
'pigweed/roll_util',
'recipe_engine/step',
]
PYTHON_VERSION_COMPATIBILITY = "PY3"
def RunSteps(api):
if api.roll_util.labels_to_set:
with api.step.nest('labels_to_set') as pres:
pres.step_summary_text = repr(api.roll_util.labels_to_set)
if api.roll_util.labels_to_wait_on:
with api.step.nest('labels_to_wait_on') as pres:
pres.step_summary_text = repr(api.roll_util.labels_to_wait_on)
assert api.roll_util.test_api.format_prefix('foo') == 'foo.'
assert (
api.roll_util.normalize_remote('../foo', 'sso://host/bar')
== 'https://host.googlesource.com/foo'
)
def GenTests(api):
yield (
api.status_check.test('labels')
+ api.roll_util.properties(
labels_to_set={'Trigger': 1, 'Foo': 123},
labels_to_wait_on=['Verified', 'Good'],
)
)