I am currently implementing some test cases in robot framework. Assertion checks that the integer is working. I want to change that to enum values. This is my basic requirement.
This is the robot file that I am using (TestCase.robot
)
*** Settings ***
Library Wrapper.py
*** Test Cases ***
TC_01
${rv} Set Variable ${0} #${}
Should Be Equal As Integers ${rv} 0
In the line Should Be Equal As Integers ${rv} 0
, instead of this integer value 0
assertion , I want to convert that integer to some enum value.
something like this.
Should Be Equal As Integers ${rv} Status.OK
where Status
is a enum class which is defined in the Wrapper.py
. This Wrapper.py
is included in the TestCase.robot
as a Library
in this robot file. I can paste the content of that enum here
class Status(Enum):
OK = 0
NOT_OK = 1
so that instead of integers we can make it more readable. When I give like this I am getting error as
'(Status.OK)' cannot be converted to an integer: ValueError: invalid literal for int() with base 10: '(status.ok)'
Can you guys help to sort out this issue ?
${Status.OK}
? Also, it would help if your question included a proper minimal reproducible example rather than several small blocks of data.TestCase.robot
and aWrapper.py
and the contents are same as I posted.