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'
评论列表
文章目录