# Path: gocdapi/admin.py
# class Admin(GoBase):
#     def __init__(self, go_server):
#     def __str__(self):
#     def reload_command_repo_cache(self):
#     def _poll(self):
#     def poll_configuration(self):
#     def push_xml_configuration(self, md5, xml_data):
#     def create_pipeline_group(self, group_name):
#     def delete_pipeline_group(self, group_name):
#     def delete_pipeline(self, pipeline):
#     def update_pipeline_from_xml(self, pipeline_xml_data):
#     def create_pipeline_from_xml(self, group_name, pipeline_xml_data):
# 
# Path: gocdapi/custom_exceptions.py
# class GoCdApiException(Exception):
#     """
#     Base class for all errors
#     """
#     pass


import unittest
import xml.etree.ElementTree as ET
from gocdapi.admin import ConfigXML
from gocdapi.custom_exceptions import GoCdApiException
        with self.assertRaises(GoCdApiException):
            self.config_xml.remove_pipeline("Pipeline_False")

    def test_update_pipeline_element(self):
        pipeline_element_to_update = ET.fromstring(self.DATA2)

        pipeline_name = pipeline_element_to_update.get("name")
        pipeline_group_old = self.config_xml.get_pipeline_parent_group(pipeline_name)
        pipeline_element_old = self.config_xml.get_pipeline(pipeline_name)

        self.config_xml.update_pipeline_element(pipeline_element_to_update)

        pipeline_group_new = self.config_xml.get_pipeline_parent_group(pipeline_name)
        pipeline_element_new = self.config_xml.get_pipeline(pipeline_name)

        self.assertEqual(pipeline_element_old.get("name"), pipeline_element_new.get("name"))
        self.assertEqual(pipeline_group_old.get("group"), pipeline_group_new.get("group"))
        self.assertIsNotNone(pipeline_element_new.get("arg"))
        self.assertEqual(pipeline_element_new.get("arg"), "newarg")

        pipeline_element_to_update = ET.fromstring(self.DATA1)
        with self.assertRaises(GoCdApiException):
            self.config_xml.update_pipeline_element(pipeline_element_to_update)

    def test_add_pipeline_group_element(self):
        group_element = ET.fromstring(self.DATA4)
        self.config_xml.add_pipeline_group_element(group_element)
        self.assertIsNotNone(self.config_xml.get_pipeline_group("SuperGroup"))

        group_element = ET.fromstring(self.DATA5)

# Path: gocdapi/admin.py
# class Admin(GoBase):
#     def __init__(self, go_server):
#     def __str__(self):
#     def reload_command_repo_cache(self):
#     def _poll(self):
#     def poll_configuration(self):
#     def push_xml_configuration(self, md5, xml_data):
#     def create_pipeline_group(self, group_name):
#     def delete_pipeline_group(self, group_name):
#     def delete_pipeline(self, pipeline):
#     def update_pipeline_from_xml(self, pipeline_xml_data):
#     def create_pipeline_from_xml(self, group_name, pipeline_xml_data):
# 
# Path: gocdapi/custom_exceptions.py
# class GoCdApiException(Exception):
#     """
#     Base class for all errors
#     """
#     pass


# Path: gocdapi_tests/unittests/test_config_xml.py
import unittest
import xml.etree.ElementTree as ET
from gocdapi.admin import ConfigXML
from gocdapi.custom_exceptions import GoCdApiException

        with self.assertRaises(GoCdApiException):
            self.config_xml.remove_pipeline("Pipeline_False")

    def test_update_pipeline_element(self):
        pipeline_element_to_update = ET.fromstring(self.DATA2)

        pipeline_name = pipeline_element_to_update.get("name")
        pipeline_group_old = self.config_xml.get_pipeline_parent_group(pipeline_name)
        pipeline_element_old = self.config_xml.get_pipeline(pipeline_name)

        self.config_xml.update_pipeline_element(pipeline_element_to_update)

        pipeline_group_new = self.config_xml.get_pipeline_parent_group(pipeline_name)
        pipeline_element_new = self.config_xml.get_pipeline(pipeline_name)

        self.assertEqual(pipeline_element_old.get("name"), pipeline_element_new.get("name"))
        self.assertEqual(pipeline_group_old.get("group"), pipeline_group_new.get("group"))
        self.assertIsNotNone(pipeline_element_new.get("arg"))
        self.assertEqual(pipeline_element_new.get("arg"), "newarg")

        pipeline_element_to_update = ET.fromstring(self.DATA1)
        with self.assertRaises(GoCdApiException):
            self.config_xml.update_pipeline_element(pipeline_element_to_update)

    def test_add_pipeline_group_element(self):
        group_element = ET.fromstring(self.DATA4)
        self.config_xml.add_pipeline_group_element(group_element)
        self.assertIsNotNone(self.config_xml.get_pipeline_group("SuperGroup"))

        group_element = ET.fromstring(self.DATA5)

        with self.assertRaises(GoCdApiException):