blob: 2b00043b86fc1aa34c4c9d1d46a1071a5e7569d4 [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.
from recipe_engine import post_process
PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [
'assertions',
'cq',
'properties',
'step',
]
def RunSteps(api):
if 'raises' in api.properties:
with api.assertions.assertRaises(api.cq.CQInactive):
api.cq.experimental
with api.assertions.assertRaises(api.cq.CQInactive):
api.cq.top_level
return
api.assertions.assertEqual(
api.cq.experimental, 'expected_experimental' in api.properties)
api.assertions.assertEqual(
api.cq.top_level, 'expected_top_level' in api.properties)
def GenTests(api):
yield (
api.test('default')
+ api.cq(run_mode=api.cq.FULL_RUN)
+ api.properties(expected_top_level=True)
+ api.post_process(post_process.DropExpectation)
)
yield (
api.test('indirect and experimental')
+ api.cq(run_mode=api.cq.FULL_RUN, top_level=False, experimental=True)
+ api.properties(expected_experimental=True)
+ api.post_process(post_process.DropExpectation)
)
yield (
api.test('not a CQ run')
+ api.properties(raises=True)
+ api.post_process(post_process.DropExpectation)
)