Ejemplo n.º 1
0
 def _add_note_for_document_types_if_used(self, help_command):
     if operation_uses_document_types(help_command.obj):
         help_command.doc.style.new_paragraph()
         help_command.doc.writeln(
             '``%s`` uses document type values. Document types follow the '
             'JSON data model where valid values are: strings, numbers, '
             'booleans, null, arrays, and objects. For command input, '
             'options and nested parameters that are labeled with the type '
             '``document`` must be provided as JSON. Shorthand syntax does '
             'not support document types.' % help_command.name)
Ejemplo n.º 2
0
 def test_operation_uses_document_types_is_false_when_no_doc_types(self):
     self.assertFalse(operation_uses_document_types(self.operation_model))
Ejemplo n.º 3
0
 def test_operation_uses_document_types_if_doc_type_in_output(self):
     self.shapes['DocType'] = self.get_doc_type_shape_definition()
     self.output_shape_definition['members']['DocType'] = {
         'shape': 'DocType'
     }
     self.assertTrue(operation_uses_document_types(self.operation_model))