From: Arvind Somya Date: Thu, 21 Mar 2013 19:18:20 +0000 (-0700) Subject: Fixing the syntax error in the XML Serializer X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3cf9c8c97aa49d87b2e7d9419ae0d3c78d3c3aed;p=openstack-build%2Fneutron-build.git Fixing the syntax error in the XML Serializer This commit fixes the syntax error in the XML Serializer. Modified wsgi test to exercise this bit of code as well Fixes: Bug #1158468 Change-Id: I1bff589a46ff4884e131d7cf60551e2f400acb67 --- diff --git a/quantum/tests/unit/test_wsgi.py b/quantum/tests/unit/test_wsgi.py index 29369f856..883314b33 100644 --- a/quantum/tests/unit/test_wsgi.py +++ b/quantum/tests/unit/test_wsgi.py @@ -186,16 +186,18 @@ class SerializerTest(base.BaseTestCase): """ content_type = 'application/xml' data_string = ( - '' + '' + '' 'passed' + '' '' ) - metadata = {'plurals': ['servers', 'test'], 'xmlns': 'fake'} + metadata = {'plurals': {'servers': 'server'}, 'xmlns': 'fake'} serializer = wsgi.Serializer( default_xmlns="fake", metadata=metadata) result = serializer.deserialize(data_string, content_type) - expected = {'body': {'servers': ['passed']}} + expected = {'body': {'servers': [{'name': 's1', 'test': 'passed'}]}} self.assertEqual(expected, result) diff --git a/quantum/wsgi.py b/quantum/wsgi.py index 707751c0d..e1c101372 100644 --- a/quantum/wsgi.py +++ b/quantum/wsgi.py @@ -583,7 +583,7 @@ class XMLDeserializer(TextDeserializer): attr == constants.XSI_ATTR or attr == constants.TYPE_ATTR): continue - result[self._get_key(attr)] = node.get[attr] + result[self._get_key(attr)] = node.get(attr) children = list(node) for child in children: result[self._get_key(child.tag)] = self._from_xml_node(