def test_list_hosting_device_templates_sort(self):
     """list hosting device templates: --sort-key name --sort-key id
     --sort-key asc
     --sort-key desc
     """
     resources = "hosting_device_templates"
     cmd = hostingdevicetemplate.HostingDeviceTemplateList(
         test_cli20.MyApp(sys.stdout), None)
     response_contents = [{
         self.id_field: 'myid1',
         'name': 'device_template_1_name',
         'host_category': 'VM',
         'service_types': "L3,FW",
         'image': 'some_glance_image_1',
         'enabled': True
     }, {
         self.id_field: 'myid2',
         'name': 'device_template_2_name',
         'host_category': 'VM',
         'service_types': "L3,FW",
         'image': 'some_glance_image_2',
         'enabled': True
     }]
     self._test_list_resources(resources,
                               cmd,
                               sort_key=["name", "id"],
                               sort_dir=["asc", "desc"],
                               response_contents=response_contents)
Ejemplo n.º 2
0
 def test_list_hosting_device_templates_limit(self):
     """list hosting device templates: -P."""
     resources = "hosting_device_templates"
     cmd = hostingdevicetemplate.HostingDeviceTemplateList(
         test_cli20.MyApp(sys.stdout), None)
     response_contents = [{
         self.id_field: 'myid1', 'name': 'device_template_1_name',
         'host_category': 'VM', 'service_types': "L3,FW",
         'image': 'some_glance_image_1', 'enabled': True}, {
         self.id_field: 'myid2', 'name': 'device_template_2_name',
         'host_category': 'VM', 'service_types': "L3,FW",
         'image': 'some_glance_image_2', 'enabled': True}]
     self._test_list_resources(resources, cmd, page_size=1000,
                               response_contents=response_contents)