def test_delete_build_configuration_id(mock_configs_api, mock_delete_specific,
                                       mock_list_configs, mock_set_id):
    result = buildconfigurations.delete_build_configuration_raw(id=1)
    mock_set_id.assert_called_once_with(mock_configs_api, 1, None)
    mock_list_configs.assert_called_once_with(page_size=1000000000)
    mock_delete_specific.assert_called_once_with(id=1)
    assert result
def test_delete_build_configuration_hasdep(mock_configs_api,
                                           mock_delete_specific,
                                           mock_list_configs, mock_set_id):
    with pytest.raises(CommandError):
        result = buildconfigurations.delete_build_configuration_raw(id='1')
    mock_set_id.assert_called_once_with(mock_configs_api, '1', None)
    mock_list_configs.assert_called_once_with(page_size=1000000000)
    mock_delete_specific.assert_not_called
Beispiel #3
0
 def teardown():
     buildconfigurations.delete_build_configuration_raw(id=created_bc.id)
def test_delete_build_configuration_hasdep(mock_configs_api, mock_delete_specific, mock_list_configs, mock_set_id):
    with pytest.raises(CommandError):
        result = buildconfigurations.delete_build_configuration_raw(id='1')
    mock_set_id.assert_called_once_with(mock_configs_api, '1', None)
    mock_list_configs.assert_called_once_with(page_size=1000000000)
    mock_delete_specific.assert_not_called
def test_delete_build_configuration_name(mock_configs_api, mock_delete_specific, mock_list_configs, mock_set_id):
    result = buildconfigurations.delete_build_configuration_raw(name='testerino')
    mock_set_id.assert_called_once_with(mock_configs_api, None, 'testerino')
    mock_list_configs.assert_called_once_with(page_size=1000000000)
    mock_delete_specific.assert_called_once_with(id=1)
    assert result
Beispiel #6
0
 def teardown():
     buildconfigurations.delete_build_configuration_raw(id=created_bc.id)