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

Fixes some unittests

This commit is contained in:
Adam 2014-10-30 22:40:07 +08:00
parent 7a564d86f4
commit f4ea244dc9
2 changed files with 9 additions and 9 deletions

View File

@ -22,8 +22,8 @@ class SceneTests(test.SickbeardTestDBCase):
dot_expected = [x.replace(' ', '.') for x in expected]
self.assertTrue(len(set(dot_expected).intersection(set(dot_result))) == len(dot_expected))
def _test_allPossibleShowNames(self, name, tvdbid=0, expected=[]):
s = Show(tvdbid)
def _test_allPossibleShowNames(self, name, indexerid=0, expected=[]):
s = Show(1, indexerid)
s.name = name
result = show_name_helpers.allPossibleShowNames(s)
@ -48,7 +48,7 @@ class SceneTests(test.SickbeardTestDBCase):
for testCase in listOfcases:
scene_name, show_name = testCase
s = Show(0)
s = Show(1, 0)
s.name = show_name
self._test_isGoodName(scene_name, s)
@ -69,7 +69,7 @@ class SceneTests(test.SickbeardTestDBCase):
def test_allPossibleShowNames(self):
#common.sceneExceptions[-1] = ['Exception Test']
myDB = db.DBConnection("cache.db")
myDB.action("INSERT INTO scene_exceptions (indexer_id, show_name) VALUES (?,?)", [-1, 'Exception Test'])
myDB.action("INSERT INTO scene_exceptions (indexer_id, show_name, season) VALUES (?,?,?)", [-1, 'Exception Test', -1])
common.countryList['Full Country Name'] = 'FCN'
self._test_allPossibleShowNames('Show Name', expected=['Show Name'])

View File

@ -29,11 +29,11 @@ class TVShowTests(test.SickbeardTestDBCase):
super(TVShowTests, self).setUp()
sickbeard.showList = []
def test_init_tvdbid(self):
def test_init_indexerid(self):
show = TVShow(1, 0001, "en")
self.assertEqual(show.tvdbid, 0001)
self.assertEqual(show.indexerid, 0001)
def test_change_tvdbid(self):
def test_change_indexerid(self):
show = TVShow(1, 0001, "en")
show.name = "show name"
show.tvrname = "show name"
@ -47,11 +47,11 @@ class TVShowTests(test.SickbeardTestDBCase):
show.saveToDB()
show.loadFromDB(skipNFO=True)
show.tvdbid = 0002
show.indexerid = 0002
show.saveToDB()
show.loadFromDB(skipNFO=True)
self.assertEqual(show.tvdbid, 0002)
self.assertEqual(show.indexerid, 0002)
def test_set_name(self):
show = TVShow(1, 0001, "en")