1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-04 15:12:23 -05:00

Fix some of the unit tests

This commit is contained in:
Adam 2014-09-16 17:57:13 +08:00
parent 9e20c33013
commit f0d8bcb62c
3 changed files with 10 additions and 9 deletions

View File

@ -205,7 +205,8 @@ class Quality:
else:
return Quality.UNKNOWN
if checkName(["(pdtv|hdtv|dsr|tvrip).(xvid|x264|h.?264)"], all) and not checkName(["(720|1080)[pi]"], all):
if checkName(["(pdtv|hdtv|dsr|tvrip).(xvid|x264|h.?264)"], all) and not checkName(["(720|1080)[pi]"], all) and\
not checkName(["hr.ws.pdtv.x264"], any):
return Quality.SDTV
elif checkName(["web.dl|webrip", "xvid|x264|h.?264"], all) and not checkName(["(720|1080)[pi]"], all):
return Quality.SDTV

View File

@ -100,12 +100,12 @@ class SceneExceptionTestCase(test.SickbeardTestDBCase):
self.assertEqual(sorted(scene_exceptions.get_scene_exceptions(70726)), ['Babylon 5', 'Babylon5'])
def test_sceneExceptionByName(self):
self.assertEqual(scene_exceptions.get_scene_exception_by_name('Babylon5'), 70726)
self.assertEqual(scene_exceptions.get_scene_exception_by_name('babylon 5'), 70726)
self.assertEqual(scene_exceptions.get_scene_exception_by_name('Carlos 2010'), 164451)
self.assertEqual(scene_exceptions.get_scene_exception_by_name('Babylon5'), (70726, -1))
self.assertEqual(scene_exceptions.get_scene_exception_by_name('babylon 5'), (70726, -1))
self.assertEqual(scene_exceptions.get_scene_exception_by_name('Carlos 2010'), (164451, -1))
def test_sceneExceptionByNameEmpty(self):
self.assertEqual(scene_exceptions.get_scene_exception_by_name('nothing useful'), None)
self.assertEqual(scene_exceptions.get_scene_exception_by_name('nothing useful'), (None, None))
def test_sceneExceptionsResetNameCache(self):
# clear the exceptions

View File

@ -68,15 +68,15 @@ class XEMBasicTests(test.SickbeardTestDBCase):
name = "Game.of.Thrones.S03.720p.HDTV.x264-CtrlHD"
release = "Game of Thrones"
m = re.match('(?P<ep_ab_num>(?>\d{1,3})(?![ip])).+', name)
# m = re.match('(?P<ep_ab_num>(?>\d{1,3})(?![ip])).+', name)
escaped_name = re.sub('\\\\[\\s.-]', '\W+', re.escape(release))
curRegex = '^' + escaped_name + '\W+(?:(?:S\d[\dE._ -])|(?:\d\d?x)|(?:\d{4}\W\d\d\W\d\d)|(?:(?:part|pt)[\._ -]?(\d|[ivx]))|Season\W+\d+\W+|E\d+\W+|(?:\d{1,3}.+\d{1,}[a-zA-Z]{2}\W+[a-zA-Z]{3,}\W+\d{4}.+))'
print(u"Checking if show " + name + " matches " + curRegex)
# print(u"Checking if show " + name + " matches " + curRegex)
match = re.search(curRegex, name, re.I)
if match:
print(u"Matched " + curRegex + " to " + name)
# if match:
# print(u"Matched " + curRegex + " to " + name)
if __name__ == "__main__":