1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-08-13 16:53:54 -04:00
SickRage/tests/xem_tests.py
echel0n 3a60683327 Fixed issues with parsing release names and naming patterns including regex for sports is now more accurate then ever!
Added option under general settings to allow specifiying a default indexer to be used for adding newshows and existing shows (All, TVDB, TVRage)
2014-05-01 17:57:51 -07:00

66 lines
2.3 KiB
Python

# coding=UTF-8
# Author: Dennis Lutter <lad1337@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Sick Beard is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
from __future__ import with_statement
import unittest
import sys, os.path
import datetime
sys.path.append(os.path.abspath('..'))
sys.path.append(os.path.abspath('../lib'))
import test_lib as test
import sickbeard
from sickbeard.helpers import sanitizeSceneName
from sickbeard.name_parser.parser import NameParser
from sickbeard.tv import TVShow
class XEMBasicTests(test.SickbeardTestDBCase):
def loadFromDB(self):
"""
Populates the showList with shows from the database
"""
myDB = test.db.DBConnection()
sqlResults = myDB.select("SELECT * FROM tv_shows")
for sqlShow in sqlResults:
try:
curShow = TVShow(int(sqlShow["indexer"]), int(sqlShow["indexer_id"]))
sickbeard.showList.append(curShow)
except Exception, e:
print "There was an error creating the show"
def test_formating(self):
self.loadFromDB()
release = "d:\\Downloads\\newdownload\\2.Broke.Girls.S03E10.And.the.First.Day.of.School.720p.WEB-DL.DD5.1.H.264-BS.mkv"
# parse the name to break it into show name, season, and episode
np = NameParser(file)
parse_result = np.parse(release).convert()
print(parse_result)
if __name__ == "__main__":
print "=================="
print "STARTING - XEM Scene Numbering TESTS"
print "=================="
print "######################################################################"
suite = unittest.TestLoader().loadTestsFromTestCase(XEMBasicTests)