FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-143672: convert the struct module to AC by skirpichev · Pull Request #143673 · python/cpython · GitHub

Repository navigation

4 changes: 4 additions & 0 deletions Lib/test/test_inspect/test_inspect.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -6266,6 +6266,10 @@ def test_stat_module_has_signatures(self):
import stat
self._test_module_has_signatures(stat)

def test_struct_module_has_signatures(self):
import struct
self._test_module_has_signatures(struct)

def test_string_module_has_signatures(self):
import string
self._test_module_has_signatures(string)
Expand Down
6 changes: 6 additions & 0 deletions Lib/test/test_struct.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ def test_pack_into(self):
self.assertRaises((TypeError, struct.error), struct.pack_into, b'', sb,
None)

# Just a wrong buf.
self.assertRaises(TypeError, s.pack_into, "ЫЫЫ", 0, b'gravitsappa')

def test_pack_into_fn(self):
test_string = b'Reykjavik rocks, eow!'
writable_buf = array.array('b', b' '*100)
Expand All @@ -484,6 +487,9 @@ def test_pack_into_fn(self):
self.assertRaises((ValueError, struct.error), pack_into, small_buf, 2,
test_string)

# Just a wrong buf.
self.assertRaises(TypeError, pack_into, "ЫЫЫ", 0, b'pepelats')

def test_unpack_with_buffer(self):
# SF bug 1563759: struct.unpack doesn't support buffer protocol objects
data1 = array.array('B', b'\x12\x34\x56\x78')
Expand Down
Loading
Loading

Back | FazBrowse Home | New Git URL