[arretsurimages] fix #1691, correctly implement search and add a test

This commit is contained in:
Bezleputh 2014-12-18 18:04:28 +01:00 committed by Florent Fourcot
commit 71347cb8f7
4 changed files with 17 additions and 7 deletions

View file

@ -17,12 +17,19 @@
# 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
from weboob.tools.test import BackendTest, SkipTest
class ArretSurImagesTest(BackendTest):
MODULE = 'arretsurimages'
def test_arretsurimages(self):
raise NotImplementedError()
def test_latest_arretsurimages(self):
l = list(self.backend.iter_resources([BaseVideo], [u'latest']))
assert len(l)
if self.backend.browser.username != u'None':
v = l[0]
self.backend.fillobj(v, ('url',))
self.assertTrue(v.url, 'URL for video "%s" not found' % (v.id))
else:
raise SkipTest("User credentials not defined")