Lines Matching refs:pack
38 self.assertEqual((struct.pack('=i', 1)[0] == 0), ISBIGENDIAN)
52 self.assertRaises(struct.error, struct.pack, 'iii', 3)
53 self.assertRaises(struct.error, struct.pack, 'i', 3, 3, 3)
54 self.assertRaises((TypeError, struct.error), struct.pack, 'i', 'foo')
55 self.assertRaises((TypeError, struct.error), struct.pack, 'P', 'foo')
57 s = struct.pack('ii', 1, 2)
74 s = struct.pack(format, c, b, h, i, l, f, d, t)
131 res = struct.pack(xfmt, arg)
199 def test_one(self, x, pack=struct.pack,
222 got = pack(format, x)
233 # x is out of range -- verify pack realizes that.
235 pack, format, x)
271 # to pack as integers. That is assuming the implemented
290 struct.pack, self.format,
293 struct.pack, self.format,
296 struct.pack, self.format,
299 struct.pack, self.format,
302 struct.pack, self.format,
309 struct.pack(format, obj)
311 self.fail("integer code pack failed on object "
318 struct.pack, self.format,
336 assertStructError(struct.pack, format, 0)
350 got = struct.pack(code, input)
366 packed = struct.pack("<f", smaller)
371 bigpacked = struct.pack(">f", smaller)
379 packed = struct.pack(">f", big)
386 self.assertRaises(OverflowError, struct.pack, ">f", big)
391 self.assertRaises(struct.error, struct.pack, format, 1.0)
392 self.assertRaises(struct.error, struct.pack, format, 1.5)
393 self.assertRaises(struct.error, struct.pack, 'P', 1.0)
394 self.assertRaises(struct.error, struct.pack, 'P', 1.5)
491 packedFalse = struct.pack(falseFormat, *false)
495 packedTrue = struct.pack(trueFormat, *true)
506 packed = struct.pack(prefix+'?', 1)
515 struct.pack(prefix + '?', ExplodingBool())
519 self.fail("Expected OSError: struct.pack(%r, "
536 self.assertRaises(struct.error, struct.pack, '12345')
542 self.assertRaises(struct.error, struct.pack, 'c12345', 'x')
550 self.assertRaises(struct.error, struct.pack, '14s42', 'spam and eggs')
606 r'no space to pack 4 bytes at offset -2'):
665 self.pack = struct.pack
667 self.pack('I', -42)
716 struct.pack('H', 70000) # too large
718 struct.pack('H', -1) # too small
725 struct.pack('h', 70000) # too large
727 struct.pack('h', -70000) # too small
821 self.assertEqual(le_bits, struct.pack('<e', f))
823 self.assertEqual(be_bits, struct.pack('>e', f))
826 self.assertEqual(le_bits, struct.pack('e', f))
829 self.assertEqual(be_bits, struct.pack('e', f))
847 packed = struct.pack('<e', math.nan)
849 packed = struct.pack('<e', -math.nan)
876 self.assertEqual(bits, struct.pack(formatcode, f))
896 self.assertRaises(OverflowError, struct.pack, formatcode, f)
904 self.assertEqual(bits, struct.pack(formatcode, f))