blob: 9de1887c7fd426bc7e1a845b482421650f18f061 [file] [log] [blame]
sv764t8bf49982018-10-25 01:42:52 -04001*** Settings ***
2Documentation Scheduler keywords
3
4#Library StringTemplater
5#Library UUID
6Library ../attlibs/UID.py
7Library ../attlibs/StringTemplater.py
8Library DateTime
9Library Collections
10
11Resource scheduler_common.robot
12Resource json_templater.robot
13
14*** Variables ****
15${TEMPLATES} assets/templates/changemanagement
16${UTC} %Y-%m-%dT%H:%M:%SZ
17
18*** Keywords ***
19Wait 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
26Send 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
34Send 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