blob: 526fb304e4b514d70da51c50442cf6315038bd14 [file] [log] [blame]
luxin83d7b602017-09-07 11:16:03 +08001*** settings ***
2Library Collections
3Library RequestsLibrary
4Library simplejson
5Library OperatingSystem
6Library json
7Library HttpLibrary.HTTP
8
9*** Variables ***
10@{return_ok_list}= 200 201 202
11${queryswagger_url} /api/resmgr/v1/swagger.json
12
13*** Test Cases ***
14SwaggerFuncTest
15 [Documentation] query swagger info rest test
luxin43867302017-09-22 16:27:09 +080016 ${headers} Create Dictionary Content-Type=application/json Accept=application/json
17 Create Session web_session http://${RESMGR_IP}:8480 headers=${headers}
18 ${resp}= Get Request web_session ${queryswagger_url}
19 ${responese_code}= Convert To String ${resp.status_code}
20 List Should Contain Value ${return_ok_list} ${responese_code}
21 ${response_json} json.loads ${resp.content}
22 ${swagger_version}= Convert To String ${response_json['swagger']}
23 Should Be Equal ${swagger_version} 2.0