File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ def generate_swagger_object(document):
15
15
swagger ['swagger' ] = '2.0'
16
16
swagger ['info' ] = OrderedDict ()
17
17
swagger ['info' ]['title' ] = document .title
18
+ swagger ['info' ]['description' ] = document .description
18
19
swagger ['info' ]['version' ] = '' # Required by the spec
19
20
20
21
if parsed_url .netloc :
Original file line number Diff line number Diff line change 6
6
7
7
class TestBasicInfo (TestCase ):
8
8
def setUp (self ):
9
- self .document = coreapi .Document (title = 'Example API' , url = 'https://www.example.com/' )
9
+ self .document = coreapi .Document (
10
+ title = 'Example API' ,
11
+ url = 'https://www.example.com/' ,
12
+ description = 'Example description.' ,
13
+ )
10
14
self .swagger = generate_swagger_object (self .document )
11
15
12
16
def test_info (self ):
13
17
self .assertIn ('info' , self .swagger )
14
18
expected = {
15
19
'title' : self .document .title ,
16
- 'version' : ''
20
+ 'version' : '' ,
21
+ 'description' : self .document .description ,
17
22
}
18
23
self .assertEquals (self .swagger ['info' ], expected )
19
24
You can’t perform that action at this time.
0 commit comments