def test_gen_map_type_docs(self): p = self.get_param_object('sqs.SetQueueAttributes.Attributes') argument = CLIArgument(p.cli_name, p, p.operation) help_command = OperationHelpCommand(self.session, p.operation, None, {p.cli_name: argument}) help_command.param_shorthand.add_example_fn(p.cli_name, help_command) self.assertTrue(p.example_fn) doc_string = p.example_fn(p) self.assertEqual(doc_string, MAPHELP)
def test_gen_list_structure_multiple_scalar_docs(self): p = self.get_param_object('elastictranscoder.CreateJob.Playlists') argument = CLIArgument(p.cli_name, p, p.operation) help_command = OperationHelpCommand(self.session, p.operation, None, {p.cli_name: argument}) help_command.param_shorthand.add_example_fn(p.cli_name, help_command) self.assertTrue(p.example_fn) doc_string = p.example_fn(p) s = 'Key value pairs, where values are separated by commas.\n--playlists Name=string1,Format=string1,OutputKeys=string1,string2' self.assertEqual(doc_string, s)
def test_gen_list_scalar_docs(self): p = self.get_param_object( 'elb.RegisterInstancesWithLoadBalancer.Instances') argument = CLIArgument(p.cli_name, p, p.operation) help_command = OperationHelpCommand(self.session, p.operation, None, {p.cli_name: argument}) help_command.param_shorthand.add_example_fn(p.cli_name, help_command) self.assertTrue(p.example_fn) doc_string = p.example_fn(p) self.assertEqual(doc_string, '--instances InstanceId1 InstanceId2 InstanceId3')
def test_gen_list_structure_of_scalars_docs(self): p = self.get_param_object('elb.CreateLoadBalancer.Listeners') argument = CLIArgument(p.cli_name, p, p.operation) help_command = OperationHelpCommand( self.session, p.operation, None, {p.cli_name: argument}, name='create-load-balancer', event_class='elb') help_command.param_shorthand.add_example_fn(p.cli_name, help_command) self.assertTrue(p.example_fn) doc_string = p.example_fn(p) self.assertIn('Key value pairs, with multiple values separated by a space.', doc_string) self.assertIn('Protocol=string', doc_string) self.assertIn('LoadBalancerPort=integer', doc_string) self.assertIn('InstanceProtocol=string', doc_string) self.assertIn('InstancePort=integer', doc_string) self.assertIn('SSLCertificateId=string', doc_string)
def test_gen_list_structure_list_scalar_scalar_docs(self): # Verify that we have *two* top level list items displayed, # so we make it clear that multiple values are separated by spaces. p = self.get_param_object('ec2.DescribeInstances.Filters') argument = CLIArgument(p.cli_name, p, p.operation) help_command = OperationHelpCommand(self.session, p.operation, None, {p.cli_name: argument}, name='describe-instances', event_class='ec2') help_command.param_shorthand.add_example_fn(p.cli_name, help_command) doc_string = p.example_fn(p) self.assertIn('multiple pairs are separated by spaces', doc_string) self.assertIn( 'Name=string1,Values=string1,string2 ' 'Name=string1,Values=string1,string2', doc_string)