ward.expect¶
Standard API¶
- ward.expect.assert_equal(lhs_val: Any, rhs_val: Any, assert_msg: str) → None¶
Check whether two objects are equal. Raises a
TestFailureif not. :param lhs_val: The value on the left side of==:param rhs_val: The value on the right side of==:param assert_msg: The assertion message from theassertstatementReturns: None Raises: TestFailure
- ward.expect.assert_greater_than(lhs_val: Any, rhs_val: Any, assert_msg: str) → None¶
Check lhs_val is greater than the rhs_val via
lhs_val > rhs_val. RaisesTestFailureif not.- Parameters
lhs_val – The value on the left side of
>rhs_val – The value on the right side of
>assert_msg – The assertion message from the
assertstatement
Returns: None Raises: TestFailure
- ward.expect.assert_greater_than_equal_to(lhs_val: Any, rhs_val: Any, assert_msg: str) → None¶
Check lhs_val is greater than or equal to the rhs_val via
lhs_val >= rhs_val. RaisesTestFailureif not.- Parameters
lhs_val – The value on the left side of
>=rhs_val – The value on the right side of
>=assert_msg – The assertion message from the
assertstatement
Returns: None Raises: TestFailure
- ward.expect.assert_in(lhs_val: Any, rhs_val: Any, assert_msg: str) → None¶
Check if an object is contained within another via
lhs_val in rhs_val. RaisesTestFailureif not.- Parameters
lhs_val – The value on the left side of
inrhs_val – The value on the right side of
inassert_msg – The assertion message from the
assertstatement
Returns: None Raises: TestFailure
- ward.expect.assert_is(lhs_val: Any, rhs_val: Any, assert_msg: str) → None¶
Check the object identity via
lhs_val is rhs_val. RaisesTestFailureif not identical.- Parameters
lhs_val – The value on the left side of
isrhs_val – The value on the right side of
isassert_msg – The assertion message from the
assertstatement
Returns: None Raises: TestFailure
- ward.expect.assert_is_not(lhs_val: Any, rhs_val: Any, assert_msg: str) → None¶
Check the object identity via
lhs_val is not rhs_val. RaisesTestFailureif identical.- Parameters
lhs_val – The value on the left side of
is notrhs_val – The value on the right side of
is notassert_msg – The assertion message from the
assertstatement
Returns: None Raises: TestFailure
- ward.expect.assert_less_than(lhs_val: Any, rhs_val: Any, assert_msg: str) → None¶
Check lhs_val is less than the rhs_val via
lhs_val < rhs_val. RaisesTestFailureif not.- Parameters
lhs_val – The value on the left side of
<rhs_val – The value on the right side of
<assert_msg – The assertion message from the
assertstatement
Returns: None Raises: TestFailure
- ward.expect.assert_less_than_equal_to(lhs_val: Any, rhs_val: Any, assert_msg: str) → None¶
Check lhs_val is less than or equal to the rhs_val via
lhs_val <= rhs_val. RaisesTestFailureif not.- Parameters
lhs_val – The value on the left side of
<=rhs_val – The value on the right side of
<=assert_msg – The assertion message from the
assertstatement
Returns: None Raises: TestFailure
- ward.expect.assert_not_equal(lhs_val: Any, rhs_val: Any, assert_msg: str) → None¶
Check whether two objects are not equal to each other. Raises a
TestFailureif not.- Parameters
lhs_val – The value on the left side of
!=rhs_val – The value on the right side of
!=assert_msg – The assertion message from the
assertstatement
Returns: None Raises: TestFailure
- ward.expect.assert_not_in(lhs_val: Any, rhs_val: Any, assert_msg: str) → None¶
Check if an object is not contained within another via
lhs_val not in rhs_val. RaisesTestFailureif lhs is contained within rhs.- Parameters
lhs_val – The value on the left side of
not inrhs_val – The value on the right side of
not inassert_msg – The assertion message from the
assertstatement
Returns: None Raises: TestFailure
- class ward.expect.raises(expected_ex_type: Type[ward.expect._E])¶