def test_get_link_hrefs(self):
     links = LinkUtils.get_link_hrefs(
         self._client.get('https://localhost:8443/tc-server/v1/groups/0/'),
         'node')
     self.assertEqual([
         'https://localhost:8443/tc-server/v1/nodes/1/',
         'https://localhost:8443/tc-server/v1/nodes/0/'
     ], links)
Example #2
0
 def _create_resources_from_links(self, rel, resource_class):
     return [resource_class(self.__client, location) for location in LinkUtils.get_link_hrefs(self.__details, rel)]
Example #3
0
 def _create_resources_from_links(self, rel, resource_class):
     return [
         resource_class(self.__client, location)
         for location in LinkUtils.get_link_hrefs(self.__details, rel)
     ]
 def test_get_link_hrefs(self):
     links = LinkUtils.get_link_hrefs(self._client.get('https://localhost:8443/tc-server/v1/groups/0/'), 'node')
     self.assertEqual(
         ['https://localhost:8443/tc-server/v1/nodes/1/', 'https://localhost:8443/tc-server/v1/nodes/0/'], links)