Lines Matching refs:randbytes
427 data = self.gen.randbytes(n)
431 self.assertEqual(self.gen.randbytes(0), b'')
434 self.assertRaises(TypeError, self.gen.randbytes)
435 self.assertRaises(TypeError, self.gen.randbytes, 1, 2)
436 self.assertRaises(ValueError, self.gen.randbytes, -1)
437 self.assertRaises(TypeError, self.gen.randbytes, 1.0)
910 self.assertEqual(self.gen.randbytes(16), expected)
914 self.assertEqual(self.gen.randbytes(0), b'')
915 self.assertEqual(self.gen.randbytes(16), expected)
919 self.assertEqual(b''.join([self.gen.randbytes(4) for _ in range(4)]),
926 self.assertEqual(b''.join(self.gen.randbytes(1) for _ in range(4)),
932 self.assertEqual(b''.join(self.gen.randbytes(2) for _ in range(4)),
938 self.assertEqual(b''.join(self.gen.randbytes(3) for _ in range(4)),
948 self.assertEqual(self.gen.randbytes(n),