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
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
def teardown(): buildconfigurations.delete_build_configuration(id=created_bc.id)
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
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