mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
Move common libs to libs/common
This commit is contained in:
parent
8dbb1a2451
commit
1f4bd41bcc
1612 changed files with 962 additions and 10 deletions
46
libs/common/guessit/test/rules/processors_test.py
Normal file
46
libs/common/guessit/test/rules/processors_test.py
Normal file
|
@ -0,0 +1,46 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# pylint: disable=no-self-use, pointless-statement, missing-docstring, invalid-name, pointless-string-statement
|
||||
|
||||
from rebulk.match import Matches, Match
|
||||
|
||||
from ...rules.processors import StripSeparators
|
||||
|
||||
|
||||
def test_strip_separators():
|
||||
strip_separators = StripSeparators()
|
||||
|
||||
matches = Matches()
|
||||
|
||||
m = Match(3, 11, input_string="pre.ABCDEF.post")
|
||||
|
||||
assert m.raw == '.ABCDEF.'
|
||||
matches.append(m)
|
||||
|
||||
returned_matches = strip_separators.when(matches, None)
|
||||
assert returned_matches == matches
|
||||
|
||||
strip_separators.then(matches, returned_matches, None)
|
||||
|
||||
assert m.raw == 'ABCDEF'
|
||||
|
||||
|
||||
def test_strip_separators_keep_acronyms():
|
||||
strip_separators = StripSeparators()
|
||||
|
||||
matches = Matches()
|
||||
|
||||
m = Match(0, 13, input_string=".S.H.I.E.L.D.")
|
||||
m2 = Match(0, 22, input_string=".Agent.Of.S.H.I.E.L.D.")
|
||||
|
||||
assert m.raw == '.S.H.I.E.L.D.'
|
||||
matches.append(m)
|
||||
matches.append(m2)
|
||||
|
||||
returned_matches = strip_separators.when(matches, None)
|
||||
assert returned_matches == matches
|
||||
|
||||
strip_separators.then(matches, returned_matches, None)
|
||||
|
||||
assert m.raw == '.S.H.I.E.L.D.'
|
||||
assert m2.raw == 'Agent.Of.S.H.I.E.L.D.'
|
Loading…
Add table
Add a link
Reference in a new issue