econwar | 9292497 | 2018-07-31 13:46:27 +0000 | [diff] [blame^] | 1 | *** Settings *** |
| 2 | Library OperatingSystem |
| 3 | Library RequestsLibrary |
| 4 | Library requests |
| 5 | Library Collections |
| 6 | Library String |
| 7 | |
| 8 | *** Variables *** |
| 9 | ${TARGETURL_FEED} https://${DR_PROV_IP}:8443 |
| 10 | ${CREATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "CSIT_Test", "business_description": "CSIT_Test", "suspend": false, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": ["${DR_PROV_IP}"], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}} |
| 11 | |
| 12 | *** Test Cases *** |
| 13 | Run Feed Creation |
| 14 | [Documentation] Feed Creation |
| 15 | [Timeout] 1 minute |
| 16 | ${resp}= PostFeed ${TARGETURL_FEED} ${CREATE_FEED_DATA} |
| 17 | log ${TARGETURL_FEED} |
| 18 | log ${resp.text} |
| 19 | Should Be Equal As Strings ${resp.status_code} 201 |
| 20 | log 'JSON Response Code:'${resp} |
| 21 | |
| 22 | |
| 23 | *** Keywords *** |
| 24 | PostFeed |
| 25 | [Arguments] ${url} ${data} |
| 26 | ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=rs873m Content-Type=application/vnd.att-dr.feed |
| 27 | ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests |
| 28 | [Return] ${resp} |