Example #1
0
    def get_favorites(self):
        results = []
        if not (settings.TVDB_USER and settings.TVDB_USER_KEY):
            return results

        user = tvdbsimple.User(settings.TVDB_USER, settings.TVDB_USER_KEY)
        for tvdbid in user.favorites():
            results.append(self.get_series_by_id(tvdbid))

        return results
Example #2
0
    def test_user_key(user, key):
        user_object = tvdbsimple.User(user, key)
        try:
            user_object.info()
        except Exception:
            logger.exception(traceback.format_exc())
            return False

        settings.TVDB_USER = user
        settings.TVDB_USER_KEY = key

        sickchill.start.save_config()

        return True
Example #3
0
    def test_user_key(self, user, key):
        user_object = tvdbsimple.User(user, key)
        try:
            user_object.info()
        except Exception:
            logger.log(traceback.format_exc(), logger.ERROR)
            return False

        sickbeard.TVDB_USER = user
        sickbeard.TVDB_USER_KEY = key

        sickbeard.save_config()

        return True
Example #4
0
 def test_user_delete_rating():
     user = tvdb.User(USER, USER_KEY)
     response = user.Ratings.delete('series', SERIES_ID)
Example #5
0
 def test_user_add_rating():
     user = tvdb.User(USER, USER_KEY)
     response = user.Ratings.add('series', SERIES_ID, 8)
Example #6
0
 def test_user_ratings(self):
     user = tvdb.User(USER, USER_KEY)
     response = user.Ratings.all()
     self.assertTrue(hasattr(user.Ratings, 'ratings'))
Example #7
0
 def test_user_delete_favorite(self):
     user = tvdb.User(USER, USER_KEY)
     response = user.delete_favorite(SERIES_ID)
     self.assertTrue(SERIES_ID not in response)
Example #8
0
 def test_user_add_favorite(self):
     user = tvdb.User(USER, USER_KEY)
     response = user.add_favorite(SERIES_ID)
     self.assertTrue(SERIES_ID in response)
Example #9
0
 def test_user_favorites(self):
     user = tvdb.User(USER, USER_KEY)
     response = user.favorites()
     self.assertTrue(hasattr(user, 'favorites'))
Example #10
0
 def test_user_info(self):
     user = tvdb.User(USER, USER_KEY)
     response = user.info()
     self.assertEqual(user.userName, USER)
Example #11
0
 def test_user_delete_rating(self):
     user = tvdb.User(USER, USER_KEY)
     user.Ratings.delete('series', SERIES_ID)
Example #12
0
 def test_user_add_rating(self):
     user = tvdb.User(USER, USER_KEY)
     user.Ratings.add('series', SERIES_ID, 8)
Example #13
0
 def test_user_delete_favorite(self):
     user = tvdb.User(USER, USER_KEY)
     response = user.delete_favorite(str(SERIES_ID))
     self.assertTrue(isinstance(response, list))
Example #14
0
 def test_user_info(self):
     user = tvdb.User(USER, USER_KEY)
     user.info()
     self.assertEqual(user.userName, USER)  # pylint: disable=no-member