Skip to content
Permalink
Browse files

Issue #29300: test_struct tests unpack_from() with keywords

Add an unit test on the _struct.Struct.unpack_from() method to test passing
arguments as keywords.
  • Loading branch information...
vstinner committed Feb 2, 2017
1 parent 94aa4ef commit a88eb4fa9e7fdf1a1050786223044c6bb7949784
Showing with 4 additions and 0 deletions.
  1. +4 −0 Lib/test/test_struct.py
@@ -428,6 +428,10 @@ def test_unpack_from(self):
for i in range(6, len(test_string) + 1):
self.assertRaises(struct.error, struct.unpack_from, fmt, data, i)

# keyword arguments
self.assertEqual(s.unpack_from(buffer=test_string, offset=2),
(b'cd01',))

def test_pack_into(self):
test_string = b'Reykjavik rocks, eow!'
writable_buf = array.array('b', b' '*100)

0 comments on commit a88eb4f

Please sign in to comment.
You can’t perform that action at this time.