Ejemplo n.º 1
0
 def test_get_groups_links(self):
     """
     `get_groups_links` gets link from `get_autoscale_links` and delegates to
     get_collection_links
     """
     links = get_groups_links('groups', 'tid', rel='rel', limit=2, marker='3')
     self.assertEqual(links, 'col links')
     self.gal.assert_called_once_with('tid', format=None)
     self.gcl.assert_called_once_with('groups', 'url', 'rel', 2, '3')
Ejemplo n.º 2
0
 def format_list(group_states):
     groups = [{
         'id': state.group_id,
         'links': get_autoscale_links(state.tenant_id, state.group_id),
         'state': format_state_dict(state)
     } for state in group_states]
     return {
         "groups": groups,
         "groups_links": get_groups_links(groups, self.tenant_id, None, **paginate)
     }
Ejemplo n.º 3
0
 def format_list(results):
     group_states, actives = results
     groups = [{
         'id': state.group_id,
         'links': get_autoscale_links(state.tenant_id, state.group_id),
         'state': format_state_dict(state, active)
     } for state, active in zip(group_states, actives)]
     return {
         "groups": groups,
         "groups_links": get_groups_links(
             groups, self.tenant_id, None, **paginate)
     }
Ejemplo n.º 4
0
 def format_list(results):
     group_states, actives = results
     groups = [{
         'id': state.group_id,
         'links': get_autoscale_links(state.tenant_id, state.group_id),
         'state': format_state_dict(state, active)
     } for state, active in zip(group_states, actives)]
     return {
         "groups": groups,
         "groups_links": get_groups_links(
             groups, self.tenant_id, None, **paginate)
     }
Ejemplo n.º 5
0
 def test_get_groups_links(self):
     """
     `get_groups_links` gets link from `get_autoscale_links` and delegates to
     get_collection_links
     """
     links = get_groups_links('groups',
                              'tid',
                              rel='rel',
                              limit=2,
                              marker='3')
     self.assertEqual(links, 'col links')
     self.gal.assert_called_once_with('tid', format=None)
     self.gcl.assert_called_once_with('groups', 'url', 'rel', 2, '3')