def test_tenant_xml_deserialization_hintless(self):
     tenant = Tenant.from_xml('<tenant \
                     xmlns="http://docs.openstack.org/identity/api/v2.0" \
                     enabled="none" id="7" name="the tenant">\
                     <description>qwerty text</description></tenant>')
     self.assertIsInstance(tenant, Tenant)
     self.assertEquals(tenant.id, "7")
     self.assertEquals(tenant.name, "the tenant")
     self.assertEquals(tenant.description, "qwerty text")
Example #2
0
 def test_tenant_xml_deserialization_hintless(self):
     tenant = Tenant.from_xml('<tenant \
                     xmlns="http://docs.openstack.org/identity/api/v2.0" \
                     enabled="none" id="7" name="the tenant">\
                     <description>qwerty text</description></tenant>')
     self.assertIsInstance(tenant, Tenant)
     self.assertEquals(tenant.id, "7")
     self.assertEquals(tenant.name, "the tenant")
     self.assertEquals(tenant.description, "qwerty text")
Example #3
0
 def test_tenant_xml_deserialization(self):
     tenant = Tenant.from_xml('<tenant \
                     xmlns="http://docs.openstack.org/identity/api/v2.0" \
                     enabled="true" id="6" name="the tenant">\
                     <description>qwerty text</description></tenant>',
                         hints={
                             "contract_attributes": ['id', 'name'],
                             "types": [("id", int),
                                 ("description", str)]})
     self.assertIsInstance(tenant, Tenant)
     self.assertEquals(tenant.id, 6)
     self.assertEquals(tenant.name, "the tenant")
     self.assertEquals(tenant.description, "qwerty text")