test_utils.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:GAMADV-XTD 作者: taers232c 项目源码 文件源码
def test_bytes(self):
        """test b() helper, bytes and native str type"""
        if PY3:
            import builtins
            self.assertIs(bytes, builtins.bytes)
        else:
            import __builtin__ as builtins
            self.assertIs(bytes, builtins.str)

        self.assertIsInstance(b'', bytes)
        self.assertIsInstance(b'\x00\xff', bytes)
        if PY3:
            self.assertEqual(b'\x00\xff'.decode("latin-1"), "\x00\xff")
        else:
            self.assertEqual(b'\x00\xff', "\x00\xff")
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号