示例#1
0
def test_get_snap_channel_prod(raises, scopes, channel):
    task = {"scopes": scopes, "payload": {"channel": channel}}
    config = {"push_to_store": True}
    if raises:
        with pytest.raises(TaskVerificationError):
            get_snap_channel(config, task)
    else:
        assert get_snap_channel(config, task) == channel
def test_get_snap_channel_prod(raises, scopes, channel):
    task = {'scopes': scopes, 'payload': {'channel': channel}}
    config = {'push_to_store': True}
    if raises:
        with pytest.raises(TaskVerificationError):
            get_snap_channel(config, task)
    else:
        assert get_snap_channel(config, task) == channel
示例#3
0
def test_old_get_snap_channel(raises, scopes, expected):
    task = {"scopes": scopes, "payload": {}}
    config = {"push_to_store": True}
    if raises:
        with pytest.raises(TaskVerificationError):
            get_snap_channel(config, task)
    else:
        assert get_snap_channel(config, task) == expected
示例#4
0
async def async_main(context):
    context.task = client.get_task(context.config)

    # TODO Sanity checks on the file
    snap_file_path = artifacts.get_snap_file_path(context)
    channel = task.get_snap_channel(context.config, context.task)

    _log_warning_forewords(context.config, channel)

    snap_store.push(context, snap_file_path, channel)
示例#5
0
def test_get_snap_channel_without_payload_raises():
    task = {"payload": {}}
    config = {}
    with pytest.raises(TaskVerificationError):
        get_snap_channel(config, task)