def test_then(with_suite):
    then_op = AssertionOperator["then"]
    results = [
        verify_assertion(8, then_op, "value + 3") == 11,
        verify_assertion(2, then_op, "value + 3") == 5,
        verify_assertion("René", then_op,
                         "'Hello ' + value + '!'") == "Hello René!"
    ]
    verify_all("then", results)
Esempio n. 2
0
def _validate_operator(operator: AssertionOperator,
                       actual,
                       expected,
                       message="",
                       custom_message=""):
    try:
        return verify_assertion(actual, operator, expected, message,
                                custom_message)
    except Exception as error:
        return error
Esempio n. 3
0
def test_then(with_suite):
    thenOp = AssertionOperator["then"]
    assert verify_assertion(8, thenOp, "value + 3") == 11
    assert verify_assertion(2, thenOp, "value + 3") == 5
    assert verify_assertion("René", thenOp,
                            "'Hello ' + value + '!'") == "Hello René!"
Esempio n. 4
0
def _validate_operator(operator: AssertionOperator, actual, expected, invalid):
    verify_assertion(actual, operator, expected)
    with pytest.raises(AssertionError):
        verify_assertion(actual, operator, invalid)
 def keyword():
     verify_assertion(3, AssertionOperator['=='], 2)
 def second_run_success(self):
     current = self.counter
     self.counter += 1
     return verify_assertion(current, AssertionOperator["=="], 2)
 def is_three(self, value):
     return verify_assertion(value, AssertionOperator["=="], 3)
def _validate_operator(operator: AssertionOperator, actual, expected):
    try:
        return verify_assertion(actual, operator, expected)
    except Exception as error:
        return error
Esempio n. 9
0
 def second_run_success(self):
     current = self.counter
     self.counter += 1
     verify_assertion(current, AssertionOperator['=='], 2)
Esempio n. 10
0
 def is_three(self, value):
     verify_assertion(value, AssertionOperator['=='], 3)