2014-03-13 23:07:15 -04:00
|
|
|
from __future__ import with_statement
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import os.path
|
|
|
|
sys.path.append(os.path.abspath('..'))
|
2014-03-14 13:15:02 -04:00
|
|
|
sys.path.append(os.path.abspath('../../../lib'))
|
2014-03-13 23:07:15 -04:00
|
|
|
|
2014-03-14 13:15:02 -04:00
|
|
|
from sickbeard.indexers.indexer_api import indexerApi
|
|
|
|
from sickbeard.indexers.indexer_exceptions import indexer_exception
|
2014-03-13 23:07:15 -04:00
|
|
|
|
|
|
|
class APICheck(unittest.TestCase):
|
2014-03-16 07:06:21 -04:00
|
|
|
indexer_id = 81189
|
|
|
|
indexer = 'Tvdb'
|
|
|
|
lang = "en"
|
2014-03-13 23:07:15 -04:00
|
|
|
|
2014-03-16 07:06:21 -04:00
|
|
|
# Set our common indexer_api options here
|
|
|
|
INDEXER_API_PARMS = {'indexer': indexer}
|
2014-03-13 23:07:15 -04:00
|
|
|
lindexer_api_parms = INDEXER_API_PARMS.copy()
|
|
|
|
|
|
|
|
try:
|
2014-03-16 07:06:21 -04:00
|
|
|
lang_id = indexerApi().config['langabbv_to_id'][lang]
|
2014-03-14 13:15:02 -04:00
|
|
|
t = indexerApi(cache=True, **lindexer_api_parms)
|
|
|
|
myEp = t[indexer_id]
|
2014-03-13 23:07:15 -04:00
|
|
|
|
|
|
|
if getattr(myEp, 'seriesname', None) is not None:
|
|
|
|
print "FOUND"
|
|
|
|
|
|
|
|
except indexer_exception as e:
|
|
|
|
print e
|
|
|
|
pass
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
unittest.main()
|