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-14 13:15:02 -04:00
|
|
|
indexer_id = 'Continum'
|
|
|
|
indexer = 'TVRage'
|
2014-03-13 23:07:15 -04:00
|
|
|
# Set our common indexer_api options here
|
2014-03-14 13:15:02 -04:00
|
|
|
INDEXER_API_PARMS = {'apikey': 'Uhewg1Rr0o62fvZvUIZt',
|
2014-03-13 23:07:15 -04:00
|
|
|
'language': 'en',
|
|
|
|
'useZip': True}
|
|
|
|
|
|
|
|
|
|
|
|
INDEXER_API_PARMS['indexer'] = indexer
|
|
|
|
lindexer_api_parms = INDEXER_API_PARMS.copy()
|
|
|
|
|
|
|
|
try:
|
2014-03-14 13:15:02 -04:00
|
|
|
# showurl = indexerApi(**lindexer_api_parms).config['base_url'] + str(indexer_id) + '/all/en.zip'
|
|
|
|
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()
|