Пример #1
0
 def test_default_format_for_one_link(self):
     """
     Link can be generated from just the tenant ID and entity ID.
     """
     links = generate_entity_links("1", ["1"])
     href = "http://dfw.servers.api.rackspacecloud.com/v2/1/servers/1"
     self.assertEqual(links, {"1": [{"rel": "self", "href": href}]})
Пример #2
0
 def test_region_version_options_for_one_link(self):
     """
     Link can also be generated for a particular region and api version and
     entity type
     """
     links = generate_entity_links("1", ["1"],
                                   region="ord",
                                   api_version="1.0",
                                   entity_type="loadbalancers")
     href = ("http://ord.loadbalancers.api.rackspacecloud.com/"
             "v1.0/1/loadbalancers/1")
     self.assertEqual(links, {"1": [{"rel": "self", "href": href}]})
Пример #3
0
 def test_default_format_for_one_link(self):
     """
     Link can be generated from just the tenant ID and entity ID.
     """
     links = generate_entity_links("1", ["1"])
     href = "http://dfw.servers.api.rackspacecloud.com/v2/1/servers/1"
     self.assertEqual(links, {
         "1": [
             {
                 "rel": "self",
                 "href": href
             }
         ]
     })
Пример #4
0
 def test_region_version_options_for_one_link(self):
     """
     Link can also be generated for a particular region and api version and
     entity type
     """
     links = generate_entity_links("1", ["1"], region="ord",
                                   api_version="1.0",
                                   entity_type="loadbalancers")
     href = ("http://ord.loadbalancers.api.rackspacecloud.com/"
             "v1.0/1/loadbalancers/1")
     self.assertEqual(links, {
         "1": [
             {
                 "rel": "self",
                 "href": href
             }
         ]
     })
Пример #5
0
 def test_creates_links_for_each_entity_id(self):
     """
     If 5 ids are passed in, 5 links are returned
     """
     links = generate_entity_links("1", [str(i) for i in range(5)])
     self.assertEqual(len(links), 5)
Пример #6
0
 def test_creates_links_for_each_entity_id(self):
     """
     If 5 ids are passed in, 5 links are returned
     """
     links = generate_entity_links("1", [str(i) for i in range(5)])
     self.assertEqual(len(links), 5)