Ejemplo n.º 1
0
 def test_bits_per_byte_bad(self):
     with self.assertRaises(ValueError):
         self.assertEqual(etao.bits_to_bytes('1001010', bpb=6), 'J')
Ejemplo n.º 2
0
 def test_bitby_array_int(self):
     bit_array = [int(c) for c in '0100100001101001']
     self.assertEqual(etao.bits_to_bytes(bit_array), 'Hi')
Ejemplo n.º 3
0
 def test_bits_per_byte(self):
     self.assertEqual(etao.bits_to_bytes('1001010', bpb=7), 'J')
Ejemplo n.º 4
0
 def test_bitby_str(self):
     self.assertEqual(etao.bits_to_bytes('0100100001101001'), 'Hi')
Ejemplo n.º 5
0
 def test_bitby_array_str(self):
     bit_char_array = [c for c in '0100100001101001']
     self.assertEqual(etao.bits_to_bytes(bit_char_array), 'Hi')
Ejemplo n.º 6
0
 def test_bits_per_byte_bad(self):
     with self.assertRaises(ValueError):
         self.assertEqual(etao.bits_to_bytes('1001010', bpb=6), b'J')
Ejemplo n.º 7
0
 def test_bits_per_byte(self):
     self.assertEqual(etao.bits_to_bytes('1001010', bpb=7), b'J')
Ejemplo n.º 8
0
 def test_bitby_array_int(self):
     bit_array = [int(c) for c in '0100100001101001']
     self.assertEqual(etao.bits_to_bytes(bit_array), b'Hi')
Ejemplo n.º 9
0
 def test_bitby_array_str(self):
     bit_char_array = [c for c in '0100100001101001']
     self.assertEqual(etao.bits_to_bytes(bit_char_array), b'Hi')
Ejemplo n.º 10
0
 def test_bitby_str(self):
     self.assertEqual(etao.bits_to_bytes('0100100001101001'), b'Hi')