test_amf3.py 文件源码

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

项目:Tinychat-Bot--Discontinued 作者: Tinychat 项目源码 文件源码
def test_compressed(self):
        """
        ByteArrays can be compressed. Test the C{compressed} attribute for
        validity.
        """
        try:
            import zlib
        except ImportError:
            self.skipTest('zlib is missing')

        ba = amf3.ByteArray()

        self.assertFalse(ba.compressed)

        z = zlib.compress('b' * 100)
        ba = amf3.ByteArray(z)

        self.assertTrue(ba.compressed)

        z = zlib.compress('\x00' * 100)
        ba = amf3.ByteArray(z)

        self.assertTrue(ba.compressed)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号