Beispiel #1
0
def test_no_force_upload(mocker, testing_workdir, testing_metadata):
    with open(os.path.join(testing_workdir, '.condarc'), 'w') as f:
        f.write('anaconda_upload: True\n')
        f.write('conda_build:\n')
        f.write('    force_upload: False\n')
    del testing_metadata.meta['test']
    api.output_yaml(testing_metadata, 'meta.yaml')
    args = ['--no-force-upload', testing_workdir]
    call = mocker.patch.object(conda_build.build.subprocess, 'call')
    reset_context(testing_workdir)
    main_build.execute(args)
    pkg = api.get_output_file_path(testing_metadata)
    assert call.called_once_with(['anaconda', 'upload', pkg])
    args = [testing_workdir]
    with open(os.path.join(testing_workdir, '.condarc'), 'w') as f:
        f.write('anaconda_upload: True\n')
    main_build.execute(args)
    assert call.called_once_with(['anaconda', 'upload', '--force', pkg])
Beispiel #2
0
def test_no_force_upload(mocker, testing_workdir, testing_metadata):
    with open(os.path.join(testing_workdir, '.condarc'), 'w') as f:
        f.write('anaconda_upload: True\n')
        f.write('conda_build:\n')
        f.write('    force_upload: False\n')
    del testing_metadata.meta['test']
    api.output_yaml(testing_metadata, 'meta.yaml')
    args = ['--no-force-upload', testing_workdir]
    call = mocker.patch.object(conda_build.build.subprocess, 'call')
    reset_context(testing_workdir)
    main_build.execute(args)
    pkg = api.get_output_file_path(testing_metadata)
    assert call.called_once_with(['anaconda', 'upload', pkg])
    args = [testing_workdir]
    with open(os.path.join(testing_workdir, '.condarc'), 'w') as f:
        f.write('anaconda_upload: True\n')
    main_build.execute(args)
    assert call.called_once_with(['anaconda', 'upload', '--force', pkg])