Kaydet (Commit) 0b00b6b9 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

Merged revisions 82739,82741 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r82739 | benjamin.peterson | 2010-07-09 08:28:42 -0500 (Fri, 09 Jul 2010) | 1 line

  allow more exceptions
........
  r82741 | benjamin.peterson | 2010-07-09 08:31:11 -0500 (Fri, 09 Jul 2010) | 1 line

  wrap
........
üst f6cbdcbf
......@@ -62,8 +62,8 @@ class StructTest(unittest.TestCase):
self.assertRaises(struct.error, struct.pack, 'iii', 3)
self.assertRaises(struct.error, struct.pack, 'i', 3, 3, 3)
self.assertRaises(struct.error, struct.pack, 'i', 'foo')
self.assertRaises(struct.error, struct.pack, 'P', 'foo')
self.assertRaises((TypeError, struct.error), struct.pack, 'i', 'foo')
self.assertRaises((TypeError, struct.error), struct.pack, 'P', 'foo')
self.assertRaises(struct.error, struct.unpack, 'd', 'flap')
s = struct.pack('ii', 1, 2)
self.assertRaises(struct.error, struct.unpack, 'iii', s)
......@@ -458,7 +458,8 @@ class StructTest(unittest.TestCase):
# Test bogus offset (issue 3694)
sb = small_buf
self.assertRaises(TypeError, struct.pack_into, b'1', sb, None)
self.assertRaises((TypeError, struct.error), struct.pack_into, b'', sb,
None)
def test_pack_into_fn(self):
test_string = 'Reykjavik rocks, eow!'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment