weboob-devel/modules/nolifetv/test.py
Clément Calmels 7100d35acd NolifeTV module update
Use mobile.nolife-tv.com instead of online.nolife-tv.com.
Add theme/type entries.
These changes are inspired by XBMC NolifeTV plugin from Julien Gormotte:
julien@gormotte.info

videoob> ls
~ (theme) Par theme (nolifetv)
~ (type) Par type (nolifetv)
~ (latest) Latest NolifeTV videos (nolifetv)
videoob> cd theme
videoob:/theme> ls
~ (Actualités) Actualités (nolifetv)
~ (Fictions) Fictions (nolifetv)
~ (Musique) Musique (nolifetv)
~ (Nolife) Nolife (nolifetv)
~ (Culture & Style) Culture & Style (nolifetv)
~ (Jeu vidéo) Jeu vidéo (nolifetv)
~ (Sélection pour découvrir Nolife) Sélection pour découvrir Nolife (nolifetv)
~ (Japon) Japon (nolifetv)
videoob:/theme> cd Japon
videoob:/theme/Japon> ls
~ (77) Japan in Motion (nolifetv)
~ (68) J-Top (Speed run) (nolifetv)
~ (84) Nochan (nolifetv)
~ (49) OTO (nolifetv)
~ (100) toco toco (nolifetv)
~ (112) Nihongo ga dekimasu ka (nolifetv)
~ (57) Tôkyô Café (nolifetv)
videoob:/theme/Japon> cd 57
Hint: There are more results available for nolifetv (use option -n or count command)
 1 — Tôkyô Café - 239 - La statue Gundam à Odaiba (nolifetv)
 2 — Tôkyô Café - 238 - UNCHAIN (nolifetv)
 3 — Tôkyô Café - 237 - The End au Théâtre du Châtelet (nolifetv)
 4 — Tôkyô Café - 236 - Scéance photo à Asobi Station dans le quartier de Harajuku avec YANO Anna (nolifetv)
 5 — Tôkyô Café - 235 - Le TGS 2013 vu par Suzuka (nolifetv)
 6 — Tôkyô Café - 234 - Street Live de Itowokashi à Tôkyô (chanson en intégralité) (nolifetv)
 7 — Tôkyô Café - 234 - Street Live de Itowokashi à Tôkyô (nolifetv)
 8 — Tôkyô Café - 233 - Tsume Fan Day (nolifetv)
 9 — Tôkyô Café - 232 - Puzzle & Dragons (nolifetv)
10 — Tôkyô Café - 231 - Japan Expo 2013 (nolifetv)

Signed-off-by: Clément Calmels <cboulte@gmail.com>
Signed-off-by: Romain Bignon <romain@symlink.me>
2013-12-23 13:24:24 +01:00

39 lines
1.4 KiB
Python

# -*- coding: utf-8 -*-
# Copyright(C) 2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# weboob is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.test import BackendTest
from weboob.capabilities.video import BaseVideo
class NolifeTVTest(BackendTest):
BACKEND = 'nolifetv'
def test_search(self):
l = list(self.backend.search_videos('nolife'))
self.assertTrue(len(l) > 0)
v = l[0]
self.backend.fillobj(v, ('url',))
self.assertTrue(v.url and v.url.startswith('http://'), 'URL for video "%s" not found: %s' % (v.id, v.url))
def test_latest(self):
l = list(self.backend.iter_resources([BaseVideo], [u'latest']))
assert len(l) > 0
v = l[0]
self.backend.fillobj(v, ('url',))
self.assertTrue(v.url and v.url.startswith('http://'), 'URL for video "%s" not found: %s' % (v.id, v.url))