sv764t | 8bf4998 | 2018-10-25 01:42:52 -0400 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Scheduler keywords |
| 3 | |
| 4 | #Library StringTemplater |
| 5 | #Library UUID |
| 6 | Library ../attlibs/UID.py |
| 7 | Library ../attlibs/StringTemplater.py |
| 8 | Library DateTime |
| 9 | Library Collections |
| 10 | |
| 11 | Resource scheduler_common.robot |
| 12 | Resource json_templater.robot |
| 13 | |
| 14 | *** Variables **** |
| 15 | ${TEMPLATES} assets/templates/changemanagement |
| 16 | ${UTC} %Y-%m-%dT%H:%M:%SZ |
| 17 | |
| 18 | *** Keywords *** |
| 19 | Wait For Pending Approval |
| 20 | [Documentation] Gets the schedule identified by the uuid and checks if it is in the Pending Approval state |
| 21 | [Arguments] ${uuid} ${status}=Pending Approval |
| 22 | ${resp}= Get Change Management auth schedules/${uuid} |
| 23 | ${json}= Catenate ${resp.json()} |
| 24 | Dictionary Should Contain Item ${resp.json()} status ${status} |
| 25 | |
| 26 | Send Tier2 Approval |
| 27 | [Documentation] Sends an approval post request for the given schedule using the UUID and User given and checks that request worked |
| 28 | [Arguments] ${uuid} ${user} ${status} |
| 29 | ${approval}= Create Dictionary approvalUserId=${user} approvalType=Tier 2 approvalStatus=${status} |
| 30 | ${resp}= Post Change Management auth schedules/${uuid}/approvals data=${approval} |
| 31 | Should Be Equal As Strings ${resp.status_code} 204 |
| 32 | |
| 33 | |
| 34 | Send Invalid Approval |
| 35 | [Arguments] ${uuid} ${user} |
| 36 | ${approval}= Create Dictionary approvalUserId=${user} approvalType=Tier 3 approvalStatus=Accepted |
| 37 | Run Keyword and Expect Error 400 Post Change Management auth schedules/${uuid}/approvals data=${approval} |
| 38 | |