Skip to content

Commit

Permalink
add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
escapewindow committed Jan 13, 2018
1 parent aa8c36f commit 793bb5d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scriptworker/test/test_cot_verify.py
Expand Up @@ -1219,6 +1219,23 @@ async def test_verify_parent_task_definition_failed_diff(chain, mocker):
)


@pytest.mark.asyncio
async def test_verify_parent_task_definition_failed_diff(chain, mocker):
link = cotverify.LinkOfTrust(chain.context, 'decision', "VQU9QMO4Teq7zr91FhBusg")
link.task = load_json_or_yaml(os.path.join(COTV2_DIR, "decision_hg-push.json"), is_path=True)
link.task['extra']['tasks_for'] = 'illegal'

mocker.patch.object(cotverify, 'load_json_or_yaml_from_url', new=cotv2_load_url)
mocker.patch.object(cotverify, 'load_json_or_yaml', new=cotv2_load)
mocker.patch.object(cotverify, 'get_pushlog_info', new=cotv2_pushlog)

chain.links = [link]
with pytest.raises(CoTError):
await cotverify.verify_parent_task_definition(
chain, link
)


# verify_parent_task {{{1
@pytest.mark.asyncio
@pytest.mark.parametrize("defn_fn,min_cot_version,raises", ((
Expand Down

0 comments on commit 793bb5d

Please sign in to comment.