summaryrefslogtreecommitdiffstats
path: root/tests/test_serializer.py
diff options
context:
space:
mode:
authorBrant Knudson <bknudson@us.ibm.com>2013-06-03 17:12:38 -0500
committerBrant Knudson <bknudson@us.ibm.com>2013-06-11 12:57:01 -0500
commitb0d766343bf618398df45cc1d5b4444255d986bc (patch)
tree7d224de2ee6de7348d404e4cc749aec6eb468da5 /tests/test_serializer.py
parentdc7fdb031a41f2c8e8f7479dc8e9d232a8da86de (diff)
downloadkeystone-b0d766343bf618398df45cc1d5b4444255d986bc.tar.gz
keystone-b0d766343bf618398df45cc1d5b4444255d986bc.tar.xz
keystone-b0d766343bf618398df45cc1d5b4444255d986bc.zip
Version response compatible with Folsom
This change adds <link> elements to the <version id="v2.0"> element in the version response to be compatible with the response given by the Keystone server in the Folsom release. Fixes bug 1187101 Change-Id: Ida71e2dbe3cf432d429fb739e68a83d7e009ca40
Diffstat (limited to 'tests/test_serializer.py')
-rw-r--r--tests/test_serializer.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/test_serializer.py b/tests/test_serializer.py
index ba162955..2024949b 100644
--- a/tests/test_serializer.py
+++ b/tests/test_serializer.py
@@ -250,3 +250,48 @@ class XmlSerializerTestCase(test.TestCase):
</object>
"""
self.assertSerializeDeserialize(d, xml)
+
+ def test_v2_links_special_case(self):
+ # There's special-case code (for backward compatibility) where if the
+ # data is the v2 version data, the link elements are also added to the
+ # main element.
+
+ d = {
+ "object": {
+ "id": "v2.0",
+ "status": "stable",
+ "updated": "2013-03-06T00:00:00Z",
+ "links": [{"href": "http://localhost:5000/v2.0/",
+ "rel": "self"},
+ {"href": "http://docs.openstack.org/api/openstack-"
+ "identity-service/2.0/content/",
+ "type": "text/html", "rel": "describedby"},
+ {"href": "http://docs.openstack.org/api/openstack-"
+ "identity-service/2.0/"
+ "identity-dev-guide-2.0.pdf",
+ "type": "application/pdf", "rel": "describedby"}]
+ }}
+
+ xml = """
+ <?xml version="1.0" encoding="UTF-8"?>
+ <object xmlns="http://docs.openstack.org/identity/api/v2.0"
+ id="v2.0" status="stable" updated="2013-03-06T00:00:00Z">
+ <links>
+ <link rel="self" href="http://localhost:5000/v2.0/"/>
+ <link rel="describedby"
+ href="http://docs.openstack.org/api/openstack-\
+identity-service/2.0/content/" type="text/html"/>
+ <link rel="describedby"
+ href="http://docs.openstack.org/api/openstack-\
+identity-service/2.0/identity-dev-guide-2.0.pdf" type="application/pdf"/>
+ </links>
+ <link rel="self" href="http://localhost:5000/v2.0/"/>
+ <link rel="describedby"
+ href="http://docs.openstack.org/api/openstack-\
+identity-service/2.0/content/" type="text/html"/>
+ <link rel="describedby"
+ href="http://docs.openstack.org/api/openstack-\
+identity-service/2.0/identity-dev-guide-2.0.pdf" type="application/pdf"/>
+ </object>
+ """
+ self.assertEqualXML(serializer.to_xml(d), xml)