async def async_main(context): """Run all the vcs things. Args: context (TreeContext): the treescript context. """ connector = aiohttp.TCPConnector() async with aiohttp.ClientSession(connector=connector) as session: context.session = session work_dir = context.config['work_dir'] actions_to_perform = task_action_types(context.task, context.config) await log_mercurial_version(context) if not await validate_robustcheckout_works(context): raise ScriptWorkerException("Robustcheckout can't run on our version of hg, aborting") await checkout_repo(context, work_dir) if actions_to_perform: await do_actions(context, actions_to_perform, work_dir) log.info("Done!")
def test_task_action_types_missing_action(scopes): task = {"scopes": scopes} with pytest.raises(TaskVerificationError): utils.task_action_types(task, SCRIPT_CONFIG)
def test_task_action_types_valid_scopes(actions, scopes): task = {"scopes": scopes} assert actions == utils.task_action_types(task, SCRIPT_CONFIG)
def test_task_action_types_missing_action(scopes): task = {"scopes": scopes} with pytest.raises(TaskVerificationError): utils.task_action_types(task)
def test_task_action_types_valid_scopes(scopes): task = {"scopes": scopes} assert tuple(scopes) == utils.task_action_types(task)
def test_task_action_types_invalid_action(scopes): task = {"scopes": scopes} with pytest.raises(TaskVerificationError): utils.task_action_types(task, SCRIPT_CONFIG)
def test_task_action_types_valid_scopes(actions, scopes): task = {"scopes": scopes} assert actions == utils.task_action_types(task, SCRIPT_CONFIG)