Add object type filtering to iter_resources

This commit is contained in:
Laurent Bachelier 2012-02-05 13:30:02 +01:00
commit bfb3689456
16 changed files with 92 additions and 61 deletions

View file

@ -19,14 +19,20 @@
from weboob.tools.test import BackendTest
from weboob.capabilities.video import BaseVideo
from weboob.capabilities.radio import Radio
class RadioFranceTest(BackendTest):
BACKEND = 'radiofrance'
def test_get_radios(self):
l = list(self.backend.iter_resources([]))
self.assertTrue(len(l) > 0)
l = list(self.backend.iter_resources(objs=[Radio], split_path=[]))
self.assertTrue(0 < len(l) < 30)
l = list(self.backend.iter_resources(objs=[Radio], split_path=['francebleu']))
self.assertTrue(len(l) > 30)
l = list(self.backend.iter_resources(objs=[BaseVideo], split_path=[]))
self.assertEquals(len(l), 0)
def test_get_video(self):
# this should be available up to 24/10/2014 15h00