Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame^] | 1 | *** settings *** |
| 2 | Library Collections |
| 3 | Library RequestsLibrary |
| 4 | Library OperatingSystem |
| 5 | Library json |
| 6 | |
| 7 | *** Variables *** |
| 8 | @{return_ok_list}= 200 201 202 |
| 9 | ${queryswagger_ocata_url} /api/multicloud-ocata/v0/swagger.json |
| 10 | |
| 11 | |
| 12 | *** Test Cases *** |
| 13 | OcataSwaggerTest |
| 14 | [Documentation] query swagger info rest test |
| 15 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
| 16 | Create Session web_session http://${SERVICE_IP}:${SERVICE_PORT} headers=${headers} |
| 17 | ${resp}= Get Request web_session ${queryswagger_ocata_url} |
| 18 | ${response_code}= Convert To String ${resp.status_code} |
| 19 | List Should Contain Value ${return_ok_list} ${response_code} |
| 20 | ${response_json} json.loads ${resp.content} |
| 21 | ${swagger_version}= Convert To String ${response_json['swagger']} |
| 22 | Should Be Equal ${swagger_version} 2.0 |