Exemple #1
0
 def test_validate_not_bytes_from_str(self):
     with self.assertRaises(ValueError):
         util.validate_bytes(u'\x99\x99')
Exemple #2
0
 def test_validate_not_bytes(self):
     with self.assertRaises(ValueError):
         util.validate_bytes(str)
Exemple #3
0
 def test_validate_bytes_from_bytearray(self):
     ret = util.validate_bytes(b'\xaa\xbb')
     self.assertIsInstance(ret, bytes)
Exemple #4
0
 def test_validate_not_bytes_from_str(self):
     with self.assertRaises(ValueError):
         util.validate_bytes(u'\x99\x99')
Exemple #5
0
 def test_validate_not_bytes(self):
     with self.assertRaises(ValueError):
         util.validate_bytes(str)
Exemple #6
0
 def test_validate_bytes_from_bytearray(self):
     ret = util.validate_bytes(b'\xaa\xbb')
     self.assertIsInstance(ret, bytes)