Commits

Yesudeep Mangalapilly committed 36333b5

Adds common includes and tests.

Comments (0)

Files changed (2)

     bytes_type = str
 
 
+# To avoid calling b() multiple times in tight loops.
+ZERO_BYTE = b('\x00')
+EMPTY_BYTE = b('')
+
+
 def is_bytes(obj):
     """
     Determines whether the given value is a byte string.

tests/test_common.py

         self.assertRaises(TypeError, byte_size, None)
 
 class Test_bit_size(unittest2.TestCase):
+    def test_zero(self):
+        self.assertEqual(bit_size(0), 0)
+
     def test_values(self):
         self.assertEqual(bit_size(1023), 10)
         self.assertEqual(bit_size(1024), 11)