def test_meaningful(self): '''The output it gives is meaningful''' hexified = util.hexify(self.message) self.assertEqual(hexified, '\\x00hello\\x0a\\x09FOO2')
def test_identical(self): '''Does not transform the value of the text''' import ast hexified = util.hexify(self.message) self.assertEqual(self.message, ast.literal_eval("'%s'" % hexified))