verify_values(
unique_identifier: str,
expected_value: str | float,
actual_value: str | float,
*,
tolerance: float = 0,
percentage: bool = False,
custom_message_prefix: str = "",
log_error: bool = False,
expect_fail: bool = False,
use_regex_match: bool = False,
condense_printout: bool = True
) -> bool
Compare and verify actual value with expected value.
| Parameters: |
-
unique_identifier
(str)
–
A unique identifier to add to the AssertionError, e.g. the device name.
-
expected_value
(str | float)
–
-
actual_value
(str | float)
–
-
tolerance
(float, default:
0
)
–
The acceptable difference between two floating point values, e.g. 0.0005
-
percentage
(bool, default:
False
)
–
A boolean indicating what kind of tolerance check to perform.
False means absolute tolerance: +/- tolerance.
True means percent tolerance: +/- (tolerance / 100) * value.
-
custom_message_prefix
(str, default:
''
)
–
A custom message to be prepended to the failure message.
-
log_error
(bool, default:
False
)
–
Indicate if an error should be logged instead of a failure
-
expect_fail
(bool, default:
False
)
–
Indicate if a failure is expected and should be treated as a pass
-
use_regex_match
(bool, default:
False
)
–
A boolean indicating if the strings should be compared
using regular expressions.
-
condense_printout
(bool, default:
True
)
–
A boolean indicating if the printout should be condensed.
|
| Returns: |
-
bool
–
Boolean indicating whether the check passed or failed.
|