Browse Source

small fix for doc test: check schema_name

Guénaël Muller 6 years ago
parent
commit
792f20412b
1 changed files with 5 additions and 0 deletions
  1. 5 0
      tests/func/test_doc.py

+ 5 - 0
tests/func/test_doc.py View File

@@ -298,10 +298,12 @@ class TestDocGeneration(Base):
298 298
         # TODO - G-M - Find better way to find our new schema
299 299
         # Do Better test when we were able to set correctly schema name
300 300
         # according to content
301
+        schema_name = None
301 302
         for elem in definitions.keys():
302 303
             if elem != 'MySchema':
303 304
                 schema_name = elem
304 305
                 break
306
+        assert schema_name
305 307
         schema_def = definitions[schema_name]
306 308
         assert schema_def.get('properties', {}).get('name', {}).get('type') == 'string'
307 309
         assert doc.get('paths').get('/paper').get('post').get('parameters')[0]
@@ -321,6 +323,7 @@ class TestDocGeneration(Base):
321 323
         # Do Better test when we were able to set correctly schema name
322 324
         # according to content
323 325
         definitions = doc.get('definitions', {})
326
+        schema_name = None
324 327
         for elem in definitions.keys():
325 328
             if elem != 'MySchema':
326 329
                 schema_name = elem
@@ -354,10 +357,12 @@ class TestDocGeneration(Base):
354 357
         # TODO - G-M - Find better way to find our new schema
355 358
         # Do Better test when we were able to set correctly schema name
356 359
         # according to content
360
+        schema_name = None
357 361
         for elem in definitions.keys():
358 362
             if elem != 'MySchema':
359 363
                 schema_name = elem
360 364
                 break
365
+        assert schema_name
361 366
         schema_def = definitions[schema_name]
362 367
         assert schema_def.get('properties', {}).get('name', {}).get('type') == 'string'
363 368
         assert doc.get('paths').get('/paper').get('post').get('parameters')[0]