async def test_verify_task_types(chain, decision_link, build_link, docker_image_link, mocker): chain.links = [decision_link, build_link, docker_image_link] for func in cotverify.get_valid_task_types().values(): mocker.patch.object(cotverify, func.__name__, new=noop_async) expected = {'decision': 1, 'build': 1, 'docker-image': 1, 'signing': 1} assert expected == await cotverify.verify_task_types(chain)
def test_get_task_type(): for name in cotverify.get_valid_task_types().keys(): with pytest.raises(CoTError): cotverify.guess_task_type("foo:bar:baz:{}0".format(name)) assert name == cotverify.guess_task_type("foo:bar:baz:{}".format(name))