Esempio n. 1
0
class test_XMLUtils(unittest.TestCase):

    def setUp(self):
        self.utils = XMLUtils()
        self.ipProfile = IpProfile()
        self.ip_profile_list = []
        self.ipProfile.set_ipAddress('10.10.0.0')
        self.ipProfile.set_hostname('LOCALHOST')
        self.ipProfile.set_ipType("IPV4")
        self.ip_profile_list.append(self.ipProfile)

    def test_is_profile_in_list(self):
        result = self.utils.is_profile_in_list(
            self.ipProfile, self.ip_profile_list)
        self.assertTrue(result)

    def test_getNodeXML(self):
        xml = '<network><name> NAME </name></network>'
        result = self.utils.getNodeXML(xml, "address")
        self.assertTrue(len(result) == 0)
Esempio n. 2
0
class test_XMLUtils(unittest.TestCase):

    def setUp(self):
        self.utils = XMLUtils()
        self.ipProfile = IpProfile()
        self.ip_profile_list = []
        self.ipProfile.set_ipAddress('10.10.0.0')
        self.ipProfile.set_hostname('LOCALHOST')
        self.ipProfile.set_ipType("IPV4")
        self.ip_profile_list.append(self.ipProfile)

    def test_is_profile_in_list(self):
        result = self.utils.is_profile_in_list(
            self.ipProfile, self.ip_profile_list)
        self.assertTrue(result)

    def test_getNodeXML(self):
        xml = '<network><name> NAME </name></network>'
        result = self.utils.getNodeXML(xml, "address")
        self.assertTrue(len(result) == 0)