blob: 0682b10b1ef7200e266a7565b6a58fad3ec0c0cc [file] [log] [blame]
# Copyright 2019 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [
'commit_position',
'step',
]
def RunSteps(api):
expected = ('refs/heads/main', 12345)
actual = api.commit_position.parse('refs/heads/main@{#12345}')
assert actual == expected, (actual, expected)
try:
api.commit_position.parse('main@{#12345}')
except ValueError as ex:
step_res = api.step('invalid', cmd=None)
step_res.presentation.logs['ex'] = str(ex).splitlines()
expected = 'refs/heads/main@{#12345}'
actual = api.commit_position.format('refs/heads/main', 12345)
assert actual == expected, (actual, expected)
def GenTests(api):
yield api.test('basic')