summaryrefslogtreecommitdiff
path: root/02-Keyword/tsg_adc/FileOperation.robot
blob: bbf23cb9fa86267750bdba45f390639328686065 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
*** Settings ***
Library    String
Library    json
Library    OperatingSystem
Library    RequestsLibrary
Library    Selenium2Library
Library    Collections
Library    FileLibrary
Resource    ../../02-Keyword/tsg_bfapi/Common.robot
Resource    ../../03-Variable/BifangApiVariable.txt


*** Keywords ***
insert_policyId_to_file
    [Arguments]    ${key}    ${policyId}    ${objectids}    
    ${dict}    Create Dictionary    policyId=${policyId}    objectId=${objectids}
    ${json}    json.Dumps    ${dict}    
    Alter Dict    ${path}/03-Variable/AllFlowCaseVariable.txt    ${key}    ${json}
    
insert_time_to_file
    [Arguments]    ${key}    ${starttime}    ${endtime}    
    ${value}    json.Loads    ${${key}}
    ${dict}    Create Dictionary    policyId=${value}[policyId]    objectId=${value}[objectId]     starttime=${starttime}    endtime=${endtime}
    ${json}    json.Dumps    ${dict}    
    Alter Dict    ${path}/03-Variable/AllFlowCaseVariable.txt    ${key}    ${json}