def test_create_policy_with_only_keyattributes(self):
     # Create qos policy abc.
     cmd = policy.CreateQoSPolicy(test_cli20.MyApp(sys.stdout),
                                  None)
     myid = 'myid'
     name = 'abc'
     args = [name]
     position_names = ['name']
     position_values = [name]
     self._test_create_resource(self.res, cmd, name, myid, args,
                                position_names, position_values,
                                cmd_resource=self.cmd_res)
 def test_create_policy_with_unicode(self):
     # Create qos policy u'\u7f51\u7edc'.
     cmd = policy.CreateQoSPolicy(test_cli20.MyApp(sys.stdout),
                                  None)
     myid = 'myid'
     name = u'\u7f51\u7edc'
     description = u'\u7f51\u7edc'
     args = [name, '--description', description]
     position_names = ['name', 'description']
     position_values = [name, description]
     self._test_create_resource(self.res, cmd, name, myid, args,
                                position_names, position_values,
                                cmd_resource=self.cmd_res)
 def test_create_policy_with_shared(self):
     # Create qos policy abc shared across tenants
     cmd = policy.CreateQoSPolicy(test_cli20.MyApp(sys.stdout),
                                  None)
     myid = 'myid'
     name = 'abc'
     description = 'policy_abc'
     args = [name, '--description', description, '--shared']
     position_names = ['name', 'description', 'shared']
     position_values = [name, description, True]
     self._test_create_resource(self.res, cmd, name, myid, args,
                                position_names, position_values,
                                cmd_resource=self.cmd_res)
 def test_create_policy_with_description(self):
     # Create qos policy xyz --description abc.
     cmd = policy.CreateQoSPolicy(test_cli20.MyApp(sys.stdout),
                                  None)
     myid = 'myid'
     name = 'abc'
     description = 'policy_abc'
     args = [name, '--description', description]
     position_names = ['name', 'description']
     position_values = [name, description]
     self._test_create_resource(self.res, cmd, name, myid, args,
                                position_names, position_values,
                                cmd_resource=self.cmd_res)