2015-11-24 12:34:53 +01:00
|
|
|
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
|
|
|
# may not use this file except in compliance with the License. A copy of
|
|
|
|
# the License is located at
|
|
|
|
#
|
|
|
|
# http://aws.amazon.com/apache2.0/
|
|
|
|
#
|
|
|
|
# or in the "license" file accompanying this file. This file is
|
|
|
|
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
|
|
|
# ANY KIND, either express or implied. See the License for the specific
|
|
|
|
# language governing permissions and limitations under the License.
|
2022-05-26 00:10:07 +02:00
|
|
|
from botocore.docs.example import (
|
|
|
|
RequestExampleDocumenter,
|
|
|
|
ResponseExampleDocumenter,
|
|
|
|
)
|
|
|
|
from botocore.docs.utils import DocumentedShape
|
|
|
|
from botocore.hooks import HierarchicalEmitter
|
2021-09-22 22:53:42 +02:00
|
|
|
from tests import mock
|
2015-11-24 12:34:53 +01:00
|
|
|
from tests.unit.docs import BaseDocsTest
|
|
|
|
|
|
|
|
|
|
|
|
class BaseExampleDocumenterTest(BaseDocsTest):
|
|
|
|
def setUp(self):
|
2022-05-26 00:10:07 +02:00
|
|
|
super().setUp()
|
2015-11-24 12:34:53 +01:00
|
|
|
self.event_emitter = HierarchicalEmitter()
|
|
|
|
self.request_example = RequestExampleDocumenter(
|
2022-05-26 00:10:07 +02:00
|
|
|
service_name='myservice',
|
|
|
|
operation_name='SampleOperation',
|
|
|
|
event_emitter=self.event_emitter,
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
self.response_example = ResponseExampleDocumenter(
|
2022-05-26 00:10:07 +02:00
|
|
|
service_name='myservice',
|
|
|
|
operation_name='SampleOperation',
|
|
|
|
event_emitter=self.event_emitter,
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
class TestDocumentDefaultValue(BaseExampleDocumenterTest):
|
|
|
|
def setUp(self):
|
2022-05-26 00:10:07 +02:00
|
|
|
super().setUp()
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape_to_params('Foo', 'String', 'This describes foo.')
|
|
|
|
|
|
|
|
def test_request_example(self):
|
|
|
|
self.request_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
prefix='response = myclient.call',
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' response = myclient.call(',
|
|
|
|
' Foo=\'string\'',
|
|
|
|
' )',
|
|
|
|
]
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
def test_response_example(self):
|
|
|
|
self.response_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
['::', ' {', ' \'Foo\': \'string\'', ' }']
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class TestDocumentNoMembers(BaseExampleDocumenterTest):
|
|
|
|
def setUp(self):
|
2022-05-26 00:10:07 +02:00
|
|
|
super().setUp()
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
def test_request_example(self):
|
|
|
|
self.request_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
prefix='response = myclient.call',
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
['::', ' response = myclient.call()']
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
def test_response_example(self):
|
|
|
|
self.response_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
2022-05-26 00:10:07 +02:00
|
|
|
self.assert_contains_lines_in_order(['::', ' {}'])
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
class TestTraverseAndDocumentShape(BaseExampleDocumenterTest):
|
|
|
|
def setUp(self):
|
2022-05-26 00:10:07 +02:00
|
|
|
super().setUp()
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape_to_params('Foo', 'String', 'This describes foo.')
|
|
|
|
self.event_emitter = mock.Mock()
|
|
|
|
self.request_example = RequestExampleDocumenter(
|
2022-05-26 00:10:07 +02:00
|
|
|
service_name='myservice',
|
|
|
|
operation_name='SampleOperation',
|
|
|
|
event_emitter=self.event_emitter,
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
self.response_example = ResponseExampleDocumenter(
|
2022-05-26 00:10:07 +02:00
|
|
|
service_name='myservice',
|
|
|
|
operation_name='SampleOperation',
|
|
|
|
event_emitter=self.event_emitter,
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
def test_events_emitted_response_example(self):
|
|
|
|
self.response_example.traverse_and_document_shape(
|
|
|
|
section=self.doc_structure,
|
2022-05-26 00:10:07 +02:00
|
|
|
shape=self.operation_model.input_shape,
|
|
|
|
history=[],
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
structure_section = self.doc_structure.get_section('structure-value')
|
|
|
|
print(self.event_emitter.emit.call_args_list[0][1]['section'].name)
|
|
|
|
self.assertEqual(
|
|
|
|
self.event_emitter.emit.call_args_list,
|
2022-05-26 00:10:07 +02:00
|
|
|
[
|
|
|
|
mock.call(
|
|
|
|
'docs.response-example.myservice.SampleOperation.Foo',
|
|
|
|
section=structure_section.get_section('Foo').get_section(
|
|
|
|
'member-value'
|
|
|
|
),
|
|
|
|
),
|
|
|
|
mock.call(
|
|
|
|
(
|
|
|
|
'docs.response-example.myservice.SampleOperation'
|
|
|
|
'.complete-section'
|
|
|
|
),
|
|
|
|
section=self.doc_structure,
|
|
|
|
),
|
|
|
|
],
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
def test_events_emitted_request_example(self):
|
|
|
|
self.request_example.traverse_and_document_shape(
|
|
|
|
section=self.doc_structure,
|
2022-05-26 00:10:07 +02:00
|
|
|
shape=self.operation_model.input_shape,
|
|
|
|
history=[],
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
structure_section = self.doc_structure.get_section('structure-value')
|
|
|
|
self.assertEqual(
|
|
|
|
self.event_emitter.emit.call_args_list,
|
2022-05-26 00:10:07 +02:00
|
|
|
[
|
|
|
|
mock.call(
|
|
|
|
'docs.request-example.myservice.SampleOperation.Foo',
|
|
|
|
section=structure_section.get_section('Foo').get_section(
|
|
|
|
'member-value'
|
|
|
|
),
|
|
|
|
),
|
|
|
|
mock.call(
|
|
|
|
(
|
|
|
|
'docs.request-example.myservice.SampleOperation'
|
|
|
|
'.complete-section'
|
|
|
|
),
|
|
|
|
section=self.doc_structure,
|
|
|
|
),
|
|
|
|
],
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class TestDocumentEnumValue(BaseExampleDocumenterTest):
|
|
|
|
def setUp(self):
|
2022-05-26 00:10:07 +02:00
|
|
|
super().setUp()
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape(
|
2022-05-26 00:10:07 +02:00
|
|
|
{'EnumString': {'type': 'string', 'enum': ['foo', 'bar']}}
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
self.add_shape_to_params('Foo', 'EnumString', 'This describes foo.')
|
|
|
|
|
|
|
|
def test_request_example(self):
|
|
|
|
self.request_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
prefix='response = myclient.call',
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' response = myclient.call(',
|
|
|
|
' Foo=\'foo\'|\'bar\'',
|
|
|
|
' )',
|
|
|
|
]
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
def test_response_example(self):
|
|
|
|
self.response_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
['::', ' {', ' \'Foo\': \'foo\'|\'bar\'', ' }']
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class TestDocumentMultipleDefaultValues(BaseExampleDocumenterTest):
|
|
|
|
def setUp(self):
|
2022-05-26 00:10:07 +02:00
|
|
|
super().setUp()
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape_to_params('Foo', 'String', 'This describes foo.')
|
2022-05-26 00:10:07 +02:00
|
|
|
self.add_shape_to_params(
|
|
|
|
'Bar', 'String', 'This describes bar.', is_required=True
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
def test_request_example(self):
|
|
|
|
self.request_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
prefix='response = myclient.call',
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' response = myclient.call(',
|
|
|
|
' Foo=\'string\',',
|
|
|
|
' Bar=\'string\'',
|
|
|
|
' )',
|
|
|
|
]
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
def test_response_example(self):
|
|
|
|
self.response_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' {',
|
|
|
|
' \'Foo\': \'string\',',
|
|
|
|
' \'Bar\': \'string\'',
|
|
|
|
' }',
|
|
|
|
]
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class TestDocumentInclude(BaseExampleDocumenterTest):
|
|
|
|
def setUp(self):
|
2022-05-26 00:10:07 +02:00
|
|
|
super().setUp()
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape_to_params('Foo', 'String', 'This describes foo.')
|
|
|
|
self.include_params = [
|
|
|
|
DocumentedShape(
|
2022-05-26 00:10:07 +02:00
|
|
|
name='Baz',
|
|
|
|
type_name='integer',
|
|
|
|
documentation='This describes baz.',
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
]
|
|
|
|
|
|
|
|
def test_request_example(self):
|
|
|
|
self.request_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
2015-11-24 12:34:53 +01:00
|
|
|
prefix='response = myclient.call',
|
2022-05-26 00:10:07 +02:00
|
|
|
include=self.include_params,
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' response = myclient.call(',
|
|
|
|
' Foo=\'string\',',
|
|
|
|
' Baz=123',
|
|
|
|
' )',
|
|
|
|
]
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
def test_response_example(self):
|
|
|
|
self.response_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
include=self.include_params,
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' {',
|
|
|
|
' \'Foo\': \'string\',',
|
|
|
|
' \'Baz\': 123',
|
|
|
|
' }',
|
|
|
|
]
|
2015-11-24 12:34:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class TestDocumentExclude(BaseExampleDocumenterTest):
|
|
|
|
def setUp(self):
|
2022-05-26 00:10:07 +02:00
|
|
|
super().setUp()
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape_to_params('Foo', 'String', 'This describes foo.')
|
2022-05-26 00:10:07 +02:00
|
|
|
self.add_shape_to_params(
|
|
|
|
'Bar', 'String', 'This describes bar.', is_required=True
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
self.exclude_params = ['Foo']
|
|
|
|
|
|
|
|
def test_request_example(self):
|
|
|
|
self.request_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
2015-11-24 12:34:53 +01:00
|
|
|
prefix='response = myclient.call',
|
2022-05-26 00:10:07 +02:00
|
|
|
exclude=self.exclude_params,
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' response = myclient.call(',
|
|
|
|
' Bar=\'string\'',
|
|
|
|
' )',
|
|
|
|
]
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
self.assert_not_contains_line(' Foo=\'string\'')
|
|
|
|
|
|
|
|
def test_response_example(self):
|
|
|
|
self.response_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
exclude=self.exclude_params,
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
['::', ' {', ' \'Bar\': \'string\'', ' }']
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
self.assert_not_contains_line('\'Foo\': \'string\',')
|
|
|
|
|
|
|
|
|
|
|
|
class TestDocumentList(BaseExampleDocumenterTest):
|
|
|
|
def setUp(self):
|
2022-05-26 00:10:07 +02:00
|
|
|
super().setUp()
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape(
|
2022-05-26 00:10:07 +02:00
|
|
|
{
|
|
|
|
'List': {
|
|
|
|
'type': 'list',
|
|
|
|
'member': {
|
|
|
|
'shape': 'String',
|
|
|
|
'documentation': 'A string element',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape_to_params('Foo', 'List', 'This describes the list.')
|
|
|
|
|
|
|
|
def test_request_example(self):
|
|
|
|
self.request_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
prefix='response = myclient.call',
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' response = myclient.call(',
|
|
|
|
' Foo=[',
|
|
|
|
' \'string\',',
|
|
|
|
' ]',
|
|
|
|
' )',
|
|
|
|
]
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
def test_response_example(self):
|
|
|
|
self.response_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure, self.operation_model.input_shape
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' {',
|
|
|
|
' \'Foo\': [',
|
|
|
|
' \'string\',',
|
|
|
|
' ]',
|
|
|
|
' }',
|
|
|
|
]
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
class TestDocumentMap(BaseExampleDocumenterTest):
|
|
|
|
def setUp(self):
|
2022-05-26 00:10:07 +02:00
|
|
|
super().setUp()
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape(
|
2022-05-26 00:10:07 +02:00
|
|
|
{
|
|
|
|
'Map': {
|
|
|
|
'type': 'map',
|
|
|
|
'key': {'shape': 'String'},
|
|
|
|
'value': {'shape': 'String'},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape_to_params('Foo', 'Map', 'This describes the map.')
|
|
|
|
|
|
|
|
def test_request_example(self):
|
|
|
|
self.request_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
prefix='response = myclient.call',
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' response = myclient.call(',
|
|
|
|
' Foo={',
|
|
|
|
' \'string\': \'string\'',
|
|
|
|
' }',
|
|
|
|
' )',
|
|
|
|
]
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
def test_response_example(self):
|
|
|
|
self.response_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure, self.operation_model.input_shape
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' {',
|
|
|
|
' \'Foo\': {',
|
|
|
|
' \'string\': \'string\'',
|
|
|
|
' }',
|
|
|
|
' }',
|
|
|
|
]
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
class TestDocumentStructure(BaseExampleDocumenterTest):
|
|
|
|
def setUp(self):
|
2022-05-26 00:10:07 +02:00
|
|
|
super().setUp()
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape(
|
2022-05-26 00:10:07 +02:00
|
|
|
{
|
|
|
|
'Structure': {
|
|
|
|
'type': 'structure',
|
|
|
|
'members': {
|
|
|
|
'Member': {
|
|
|
|
'shape': 'String',
|
|
|
|
'documentation': 'This is its member.',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape_to_params(
|
2022-05-26 00:10:07 +02:00
|
|
|
'Foo', 'Structure', 'This describes the structure.'
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
def test_request_example(self):
|
|
|
|
self.request_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
prefix='response = myclient.call',
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' response = myclient.call(',
|
|
|
|
' Foo={',
|
|
|
|
' \'Member\': \'string\'',
|
|
|
|
' }',
|
|
|
|
' )',
|
|
|
|
]
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
def test_response_example(self):
|
|
|
|
self.response_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure, self.operation_model.input_shape
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' {',
|
|
|
|
' \'Foo\': {',
|
|
|
|
' \'Member\': \'string\'',
|
|
|
|
' }',
|
|
|
|
' }',
|
|
|
|
]
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
class TestDocumentRecursiveShape(BaseExampleDocumenterTest):
|
|
|
|
def setUp(self):
|
2022-05-26 00:10:07 +02:00
|
|
|
super().setUp()
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape(
|
2022-05-26 00:10:07 +02:00
|
|
|
{
|
|
|
|
'Structure': {
|
|
|
|
'type': 'structure',
|
|
|
|
'members': {
|
|
|
|
'Foo': {
|
|
|
|
'shape': 'Structure',
|
|
|
|
'documentation': 'This is a recursive structure.',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
self.add_shape_to_params(
|
2022-05-26 00:10:07 +02:00
|
|
|
'Foo', 'Structure', 'This describes the structure.'
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
def test_request_example(self):
|
|
|
|
self.request_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure,
|
|
|
|
self.operation_model.input_shape,
|
|
|
|
prefix='response = myclient.call',
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' response = myclient.call(',
|
|
|
|
' Foo={',
|
|
|
|
' \'Foo\': {\'... recursive ...\'}',
|
|
|
|
' }',
|
|
|
|
' )',
|
|
|
|
]
|
|
|
|
)
|
2015-11-24 12:34:53 +01:00
|
|
|
|
|
|
|
def test_response_example(self):
|
|
|
|
self.response_example.document_example(
|
2022-05-26 00:10:07 +02:00
|
|
|
self.doc_structure, self.operation_model.input_shape
|
|
|
|
)
|
|
|
|
self.assert_contains_lines_in_order(
|
|
|
|
[
|
|
|
|
'::',
|
|
|
|
' {',
|
|
|
|
' \'Foo\': {',
|
|
|
|
' \'Foo\': {\'... recursive ...\'}',
|
|
|
|
' }',
|
|
|
|
' }',
|
|
|
|
]
|
|
|
|
)
|