CodecRar_Test.py 文件源码

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

项目:newsreap 作者: caronc 项目源码 文件源码
def test_rar_detection(self):
        """
        Tests the rar file detection process
        """
        from newsreap.codecs.CodecRar import RAR_PART_RE

        result = RAR_PART_RE.match('/path/to/test.rar')
        assert result is not None
        assert result.group('part') is None

        result = RAR_PART_RE.match('/path/to/test.RaR')
        assert result is not None
        assert result.group('part') is None

        result = RAR_PART_RE.match('/path/to/test.r01')
        assert result is not None
        assert result.group('part') == '01'

        result = RAR_PART_RE.match('/path/to/test.R200')
        assert result is not None
        assert result.group('part') == '200'

        result = RAR_PART_RE.match('/path/to/test.part65.rar')
        assert result is not None
        assert result.group('part') == '65'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号