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
TestFailure
if 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 theassert
statementReturns: 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
. RaisesTestFailure
if 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
assert
statement
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
. RaisesTestFailure
if 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
assert
statement
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
. RaisesTestFailure
if not.- Parameters
lhs_val – The value on the left side of
in
rhs_val – The value on the right side of
in
assert_msg – The assertion message from the
assert
statement
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
. RaisesTestFailure
if not identical.- Parameters
lhs_val – The value on the left side of
is
rhs_val – The value on the right side of
is
assert_msg – The assertion message from the
assert
statement
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
. RaisesTestFailure
if identical.- Parameters
lhs_val – The value on the left side of
is not
rhs_val – The value on the right side of
is not
assert_msg – The assertion message from the
assert
statement
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
. RaisesTestFailure
if 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
assert
statement
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
. RaisesTestFailure
if 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
assert
statement
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
TestFailure
if 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
assert
statement
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
. RaisesTestFailure
if lhs is contained within rhs.- Parameters
lhs_val – The value on the left side of
not in
rhs_val – The value on the right side of
not in
assert_msg – The assertion message from the
assert
statement
Returns: None Raises: TestFailure
- class ward.expect.raises(expected_ex_type: Type[ward.expect._E])¶