|
@@ -147,3 +147,22 @@ class TestDocGeneration(Base):
|
147
|
147
|
assert 'post' in doc['paths']['/upload']
|
148
|
148
|
assert 'description' in doc['paths']['/upload']['post']
|
149
|
149
|
assert 'Hello doc' == doc['paths']['/upload']['post']['description']
|
|
150
|
+
|
|
151
|
+ def test_func__tags__ok__nominal_case(self):
|
|
152
|
+ hapic = Hapic()
|
|
153
|
+ app = bottle.Bottle()
|
|
154
|
+ hapic.set_context(MyContext(app=app))
|
|
155
|
+
|
|
156
|
+ @hapic.with_api_doc(tags=['foo', 'bar'])
|
|
157
|
+ def my_controller(hapic_data=None):
|
|
158
|
+ assert hapic_data
|
|
159
|
+ assert hapic_data.files
|
|
160
|
+
|
|
161
|
+ app.route('/upload', method='POST', callback=my_controller)
|
|
162
|
+ doc = hapic.generate_doc()
|
|
163
|
+
|
|
164
|
+ assert doc.get('paths')
|
|
165
|
+ assert '/upload' in doc['paths']
|
|
166
|
+ assert 'post' in doc['paths']['/upload']
|
|
167
|
+ assert 'tags' in doc['paths']['/upload']['post']
|
|
168
|
+ assert ['foo', 'bar'] == doc['paths']['/upload']['post']['tags']
|