Skip to content

Commit

Permalink
Update API test
Browse files Browse the repository at this point in the history
  • Loading branch information
pivilartisant committed Dec 5, 2024
1 parent 9d5ae68 commit 1ed9068
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions api/test/robot_tests/cmd/cmd.robot
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ POST a Smart Contract
... nickname=${WALLET_NICKNAME}
... smartContract=${SMART_CONTRACT_BYTECODE}
... maxCoins=3000000000000
... coins=300000000000
... fee=1000000000
... coins=18500000000
... fee=1000000
${headers}= Create Dictionary Content-Type=application/json
${response}= POST ${API_URL}/cmd/deploySC json=${data} headers=${headers} expected_status=any
Log To Console json response: ${response.json()} # Print the response content to the test log for debugging

Should Be Equal As Integers ${response.status_code} ${STATUS_OK} # Assert the status code is 200 OK
Should Contain ${response.json()['firstEvent']['data']} Contract deployed at address
Should Contain ${response.json()['firstEvent']['data']} TestSC Constructor called

${sc_address}= Get SC address ${response.json()['firstEvent']['data']}
${sc_address}= Get SC address ${response.json()['firstEvent']['address']}
Log To Console ${sc_address}
Set Global Variable ${DEPLOYED_SC_ADDR} ${sc_address}

POST /cmd/read-only/callsc
Expand Down
2 changes: 1 addition & 1 deletion api/test/robot_tests/keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Get SC address
[Documentation] Get the address of the SC from a string containing the address after ':' (colon)
[Arguments] ${string}
${words}= Split String ${string} :
${sc_address}= Get From List ${words} 1
${sc_address}= Get From List ${words} 0
RETURN ${sc_address}

Switch To Buildnet
Expand Down
Loading

0 comments on commit 1ed9068

Please sign in to comment.