def test_element_to_dict(self): # Test when there is not a None exp = {'instance': {'flavor': {'links': [], 'value': {'value': '5'}}}} self.assertEqual(exp, xml.element_to_dict(self.ROOT)) # Test when there is a None element = ''' <server> None </server> ''' rt = etree.fromstring(element) self.assertEqual(None, xml.element_to_dict(rt))
def test_element_to_dict(self): exp = {'instance': {'flavor': {'links': [], 'value': {'value': '5'}}}} self.assertEqual(exp, xml.element_to_dict(self.ROOT))