def test_serialize_host_update_request_to_xml(self): quota_obj = UpdateQuotaRequest(security_groups=45, id='fake_tenant') xml_serialized_quota = quota_obj.serialize("xml") expected_xml = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>' '<quota_set id="fake_tenant">' '<security_groups>45</security_groups>' '</quota_set>') self.assertEqual(xml_serialized_quota, expected_xml)
def test_serialize_host_update_request_to_json(self): quota_obj = UpdateQuotaRequest(security_groups=45) json_serialized_quota = quota_obj.serialize("json") expected_json = '{"quota_set": {"security_groups": 45}}' self.assertEqual(json_serialized_quota, expected_json)