diff --git a/assertionengine/assertion_engine.py b/assertionengine/assertion_engine.py index 2ef0495..2a10c00 100644 --- a/assertionengine/assertion_engine.py +++ b/assertionengine/assertion_engine.py @@ -27,6 +27,7 @@ "AssertionOperator", { "equal": "==", + "equals": "==", "==": "==", "should be": "==", "inequal": "!=", @@ -56,20 +57,20 @@ AssertionOperator.__doc__ = """ Currently supported assertion operators are: - | = Operator = | = Alternative Operators = | = Description = | = Validate Equivalent = | - | ``==`` | ``equal``, ``should be`` | Checks if returned value is equal to expected value. | ``value == expected`` | - | ``!=`` | ``inequal``, ``should not be`` | Checks if returned value is not equal to expected value. | ``value != expected`` | - | ``>`` | ``greater than`` | Checks if returned value is greater than expected value. | ``value > expected`` | - | ``>=`` | | Checks if returned value is greater than or equal to expected value. | ``value >= expected`` | - | ``<`` | ``less than`` | Checks if returned value is less than expected value. | ``value < expected`` | - | ``<=`` | | Checks if returned value is less than or equal to expected value. | ``value <= expected`` | - | ``*=`` | ``contains`` | Checks if returned value contains expected value as substring. | ``expected in value`` | - | | ``not contains`` | Checks if returned value does not contain expected value as substring. | ``expected in value`` | - | ``^=`` | ``should start with``, ``starts`` | Checks if returned value starts with expected value. | ``re.search(f"^{expected}", value)`` | - | ``$=`` | ``should end with``, ``ends`` | Checks if returned value ends with expected value. | ``re.search(f"{expected}$", value)`` | - | ``matches`` | | Checks if given RegEx matches minimum once in returned value. | ``re.search(expected, value)`` | - | ``validate`` | | Checks if given Python expression evaluates to ``True``. | | - | ``evaluate`` | ``then`` | When using this operator, the keyword does return the evaluated Python expression. | | + | = Operator = | = Alternative Operators = | = Description = | = Validate Equivalent = | + | ``==`` | ``equal``, ``equals``, ``should be`` | Checks if returned value is equal to expected value. | ``value == expected`` | + | ``!=`` | ``inequal``, ``should not be`` | Checks if returned value is not equal to expected value. | ``value != expected`` | + | ``>`` | ``greater than`` | Checks if returned value is greater than expected value. | ``value > expected`` | + | ``>=`` | | Checks if returned value is greater than or equal to expected value. | ``value >= expected`` | + | ``<`` | ``less than`` | Checks if returned value is less than expected value. | ``value < expected`` | + | ``<=`` | | Checks if returned value is less than or equal to expected value. | ``value <= expected`` | + | ``*=`` | ``contains`` | Checks if returned value contains expected value as substring. | ``expected in value`` | + | | ``not contains`` | Checks if returned value does not contain expected value as substring. | ``expected in value`` | + | ``^=`` | ``should start with``, ``starts`` | Checks if returned value starts with expected value. | ``re.search(f"^{expected}", value)`` | + | ``$=`` | ``should end with``, ``ends`` | Checks if returned value ends with expected value. | ``re.search(f"{expected}$", value)`` | + | ``matches`` | | Checks if given RegEx matches minimum once in returned value. | ``re.search(expected, value)`` | + | ``validate`` | | Checks if given Python expression evaluates to ``True``. | | + | ``evaluate`` | ``then`` | When using this operator, the keyword does return the evaluated Python expression. | | Currently supported formatters for assertions are: | = Formatter = | = Description = | diff --git a/atest/assertion_equal.robot b/atest/assertion_equal.robot index 6dea79a..c3e5df9 100644 --- a/atest/assertion_equal.robot +++ b/atest/assertion_equal.robot @@ -45,6 +45,7 @@ Setting Assertion Formatters For Not Existing Formatter Should Fail Values Are Equal Is Equal 1 == 1 Is Equal As Number 1 == ${1} + Is Equal One Equals One Values Are Equal With Formatter Set Assertion Formatters {"Is Equal": ["strip", "normalize spaces"]} diff --git a/utest/approved_files/test_assertion_operator.test_assertion_operator.approved.txt b/utest/approved_files/test_assertion_operator.test_assertion_operator.approved.txt index 47b9721..a5651a7 100644 --- a/utest/approved_files/test_assertion_operator.test_assertion_operator.approved.txt +++ b/utest/approved_files/test_assertion_operator.test_assertion_operator.approved.txt @@ -1,5 +1,6 @@ equal::::AssertionOperator.equal +equals::::AssertionOperator.equal ==::::AssertionOperator.equal should be::::AssertionOperator.equal inequal::::AssertionOperator.inequal