Пример #1
0
    def test_get_version(self):
        """
        Check generation of keystone canned response, when providing only
        base_uri.
        """
        expected = {"version":
                    {"status": "stable",
                     "updated": "2014-04-17T00:00:00Z",
                     "media-types":
                     [{
                         "base": "application/json",
                         "type": "application/vnd.openstack.identity-v2.0+json"
                     }],
                     "id": "v2.0",
                     "links":
                     [{
                         "href": "http://ip_server:port/identity/v2.0",
                         "rel": "self"
                     }, {
                         "href": "http://docs.openstack.org/",
                         "type": "text/html",
                         "rel": "describedby"}]
                     }
                    }
        result = get_version_v2("http://ip_server:port/")

        self.assertEqual(json.dumps(result, sort_keys=True),
                         json.dumps(expected, sort_keys=True))
Пример #2
0
 def get_version(self, request):
     """
     Returns keystone version.
     """
     base_uri = base_uri_from_request(request)
     return json.dumps(get_version_v2(base_uri))
Пример #3
0
 def get_version(self, request):
     """
     Returns keystone version.
     """
     base_uri = base_uri_from_request(request)
     return json.dumps(get_version_v2(base_uri))