def test_generic_validation_v2(monkeypatch, release_info, values, raises):
    release_name = "Fennec-X.0bX-build42"
    ReleaseClassMock = MagicMock()
    attrs = {'getRelease.return_value': release_info}
    ReleaseClassMock.configure_mock(**attrs)

    if raises:
        with pytest.raises(ScriptWorkerTaskException):
            check_release_has_values_v2(ReleaseClassMock, release_name, {}, **values)
    else:
        check_release_has_values_v2(ReleaseClassMock, release_name, {}, **values)
Esempio n. 2
0
def mark_as_shipped_v2(shipit_config, release_name):
    """Function to make a simple call to Ship-it API v2 to change a release
    status to 'shipped'
    """
    release_api, headers = get_shipit_api_instance(shipit_config)

    log.info("Marking the release as shipped...")
    release_api.update_status(release_name, status="shipped", headers=headers)
    check_release_has_values_v2(release_api,
                                release_name,
                                headers,
                                status="shipped")
def mark_as_shipped_v2(ship_it_instance_config, release_name):
    """Function to make a simple call to Ship-it API v2 to change a release
    status to 'shipped'
    """
    (taskcluster_client_id, taskcluster_access_token, api_root,
     timeout_in_seconds) = get_auth_primitives_v2(ship_it_instance_config)
    release_api = shipitapi.Release_V2(
        taskcluster_client_id=taskcluster_client_id,
        taskcluster_access_token=taskcluster_access_token,
        api_root=api_root,
        timeout=timeout_in_seconds)

    log.info('Marking the release as shipped...')
    release_api.update_status(release_name, status='shipped')
    check_release_has_values_v2(release_api, release_name, status='shipped')