示例#1
0
def test_delete_build_configuration_id(mock_configs_api, mock_delete_specific,
                                       mock_list_configs, mock_set_id):
    result = buildconfigurations.delete_build_configuration(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
示例#2
0
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(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
示例#3
0
 def teardown():
     buildconfigurations.delete_build_configuration(id=created_bc.id)
示例#4
0
def test_delete_build_configuration_notexist(mock_delete_specific, mock_get_config_id):
    result = buildconfigurations.delete_build_configuration(name='testerino')
    mock_get_config_id.assert_called_once_with(None, 'testerino')
    assert not mock_delete_specific.called
    assert not result
示例#5
0
def test_delete_build_configuration_id(mock_delete_specific, mock_get_config_id):
    result = buildconfigurations.delete_build_configuration(id=1)
    mock_get_config_id.assert_called_once_with(1, None)
    mock_delete_specific.assert_called_once_with(id=1)
    assert result
示例#6
0
 def teardown():
     buildconfigurations.delete_build_configuration(id=created_bc.id)