Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** settings *** |
| 2 | Resource ../../common.robot |
| 3 | Library Collections |
| 4 | Library RequestsLibrary |
| 5 | Library simplejson |
| 6 | Library OperatingSystem |
| 7 | Library json |
| 8 | Library HttpLibrary.HTTP |
| 9 | |
| 10 | *** Variables *** |
| 11 | @{return_ok_list}= 200 201 202 |
| 12 | ${queryswagger_url} /api/multivimproxy/v1/swagger.json |
| 13 | |
| 14 | *** Test Cases *** |
| 15 | SwaggerFuncTest |
| 16 | [Documentation] query swagger info rest test |
| 17 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
| 18 | Create Session web_session http://${RESMGR_IP}:8481 headers=${headers} |
| 19 | ${resp}= Get Request web_session ${queryswagger_url} |
| 20 | ${responese_code}= Convert To String ${resp.status_code} |
| 21 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 22 | ${response_json} json.loads ${resp.content} |
| 23 | ${swagger_version}= Convert To String ${response_json['swagger']} |
| 24 | Should Be Equal ${swagger_version} 2.0 |