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