3333
3434class CapturedRequestLog :
3535 """Log of requests and responses for snapshot assertions.
36-
36+
3737 The log captures the raw bytes of each request and response along with
3838 a label indicating the direction of the message.
3939 """
@@ -48,7 +48,7 @@ def add_log_entry(self, label: str, data: bytes) -> None:
4848
4949 def __repr__ (self ):
5050 """Return a string representation of the log entries.
51-
51+
5252 This assumes that the client will behave in a request-response manner,
5353 so each request is followed by a response. If a test uses non-deterministic
5454 message order, this may not be accurate and the test would need to decode
@@ -65,6 +65,8 @@ def _hexdump(self, data: bytes, bytes_per_line: int = 16) -> list[str]:
6565
6666 This makes the packets easier to read and compare in test snapshots.
6767
68+
69+
6870 Args:
6971 data: The bytes object to print.
7072 bytes_per_line: The number of bytes to display per line (default is 16).
@@ -93,7 +95,7 @@ def to_printable_ascii(byte_val):
9395@pytest .fixture
9496def deterministic_message_fixtures () -> Generator [None , None , None ]:
9597 """Fixture to use predictable get_next_int and timestamp values for each test.
96-
98+
9799 This test mocks out the functions used to generate requests that have some
98100 entropy such as the nonces, timestamps, and request IDs. This makes the
99101 generated messages deterministic so we can snapshot them in a test.
0 commit comments