def test_default(self): document_shared_examples( self.doc_structure, self.operation_model, 'response = client.foo', self._examples) self.assert_contains_lines_in_order([ "**Examples**", "Sample Description.", "::", " response = client.foo(", " # mahalo", " aloha=[", " 'other',", " {", " 'nested': 'fun!',", " },", " ],", " foo='bar',", " )", " print(response)", "Expected Output:", "::", " {", " # Sample Comment", " 'foo': 'baz',", " 'ResponseMetadata': {", " '...': '...',", " },", " }", ])
def _add_model_driven_method(self, section, method_name): service_model = self._client.meta.service_model operation_name = self._client.meta.method_to_api_mapping[method_name] operation_model = service_model.operation_model(operation_name) example_prefix = 'response = client.%s' % method_name document_model_driven_method( section, method_name, operation_model, event_emitter=self._client.meta.events, method_description=operation_model.documentation, example_prefix=example_prefix, ) # Add the shared examples shared_examples = self._shared_examples.get(operation_name) if shared_examples: document_shared_examples( section, operation_model, example_prefix, shared_examples)
def _add_model_driven_method(self, section, method_name): service_model = self._client.meta.service_model operation_name = self._client.meta.method_to_api_mapping[method_name] operation_model = service_model.operation_model(operation_name) example_prefix = 'response = client.%s' % method_name document_model_driven_method( section, method_name, operation_model, event_emitter=self._client.meta.events, method_description=operation_model.documentation, example_prefix=example_prefix, ) # Add the shared examples shared_examples = self._shared_examples.get(operation_name) if shared_examples: document_shared_examples(section, operation_model, example_prefix, shared_examples)