(self)
| 610 | self.check_sizeof('0c', 0) |
| 611 | |
| 612 | def test_boundary_error_message(self): |
| 613 | regex1 = ( |
| 614 | r'pack_into requires a buffer of at least 6 ' |
| 615 | r'bytes for packing 1 bytes at offset 5 ' |
| 616 | r'\(actual buffer size is 1\)' |
| 617 | ) |
| 618 | with self.assertRaisesRegex(struct.error, regex1): |
| 619 | struct.pack_into('b', bytearray(1), 5, 1) |
| 620 | |
| 621 | regex2 = ( |
| 622 | r'unpack_from requires a buffer of at least 6 ' |
| 623 | r'bytes for unpacking 1 bytes at offset 5 ' |
| 624 | r'\(actual buffer size is 1\)' |
| 625 | ) |
| 626 | with self.assertRaisesRegex(struct.error, regex2): |
| 627 | struct.unpack_from('b', bytearray(1), 5) |
| 628 | |
| 629 | def test_boundary_error_message_with_negative_offset(self): |
| 630 | byte_list = bytearray(10) |
nothing calls this directly
no test coverage detected