示例#1
0
class TestXmlToDictEdges(base.DriverTestCase):

    def setUp(self):
        super(TestXmlToDictEdges, self).setUp()
        from libcloudcore.drivers.xml import Driver
        self.driver = Driver()
        self.model = self.driver.model

    def test_serialize_complicated_structure(self):
        operation = self.model.get_operation("test_complicated_structure")
        result = self.driver.serialize(
            operation,
            operation.output_shape,
            dict(
                text="TEXT",
                attr="ATTR",
                child="CHILD",
            ),
        )
        self.assertEqual(xmltodict.parse(result), {
            "TestComplicatedStructure": {
                "child": "CHILD",
                "@attr": "ATTR",
                "@xmlns": "http://www.example.com/",
                "#text": "TEXT",
            }
        })
示例#2
0
 def setUp(self):
     super(TestXmlToDictEdges, self).setUp()
     from libcloudcore.drivers.xml import Driver
     self.driver = Driver()
     self.model = self.driver.model