def test_binary_to_hex(self): """Test that a binary binstr can be properly converted to hex.""" binstr = '0000000000000000000000000000000000000000000000000000101010111100' hexstr = '0000000000000ABC' self.assertEquals(des.binary_to_hex(binstr), hexstr) binstr = '0001001000110100010101100111100010010000101010111100110111101111' hexstr = '1234567890ABCDEF' self.assertEquals(des.binary_to_hex(binstr), hexstr)
def test_binary_to_hex_blankstr(self): """Test that a binstr can be properly be converted to hex.""" binstr = '' hexstr = '' self.assertEquals(des.binary_to_hex(binstr), hexstr)