Skip to content

Commit

Permalink
Test padding with ones in pack_into().
Browse files Browse the repository at this point in the history
  • Loading branch information
eerimoq committed Apr 30, 2018
1 parent 0b3f33b commit 6486f21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_bitstruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,10 @@ def test_pack_into(self):
self.assertEqual(str(cm.exception),
'pack requires a buffer of at least 17 bits')

packed = bytearray(b'\x00')
pack_into('P4u4', packed, 0, 1)
self.assertEqual(packed, b'\xf1')

def test_unpack_from(self):
"""Unpack values at given bit offset.
Expand Down

0 comments on commit 6486f21

Please sign in to comment.