From 3cf9c8c97aa49d87b2e7d9419ae0d3c78d3c3aed Mon Sep 17 00:00:00 2001 From: Arvind Somya Date: Thu, 21 Mar 2013 12:18:20 -0700 Subject: [PATCH] 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 --- quantum/tests/unit/test_wsgi.py | 8 +++++--- quantum/wsgi.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) 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( -- 2.45.2