-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed as not planned
Description
I am using this library for implementing coverage tests of a Modbus product. While writing the coverage tests for coils illegal data value, I attempted to use the trace_packet handler so I could mangle the bytes to an invalid number outside of the range 1-2000 to validate that my device returns the 0x03, Illegal data value, exception code.
The issue is that the API still checks even when using this lower level handler to inject other data.
def verifyCount(self, max_count: int, count: int = -1) -> None:
"""Validate API supplied count."""
if count == -1:
count = self.count
if not 1 <= count <= max_count:
> raise ValueError(f"1 < count {count} < {max_count} !")
E ValueError: 1 < count 0 < 2000 !
Is there a recommended method to implement this type of testing with the library, or will I have to go deeper and mangle between the pdu and serial layer?
Metadata
Metadata
Assignees
Labels
No labels