From 83cb2c843fb3e223ef52b3b2f13c64da73ae826b Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 25 Jul 2013 13:44:04 +0200 Subject: [PATCH] More tests on freemobile module --- modules/freemobile/test.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/modules/freemobile/test.py b/modules/freemobile/test.py index 9795653f..80ff2603 100644 --- a/modules/freemobile/test.py +++ b/modules/freemobile/test.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2012 Romain Bignon +# Copyright(C) 2013 Florent Fourcot # # This file is part of weboob. # @@ -27,8 +27,26 @@ __all__ = ['FreeMobileTest'] class FreeMobileTest(BackendTest): BACKEND = 'freemobile' - def test_freemobile(self): + def test_details(self): + for subscription in self.backend.iter_subscription(): + details = list(self.backend.get_details(subscription)) + self.assertTrue(len(details) > 4, msg="Not enough details") + + def test_history(self): + for subscription in self.backend.iter_subscription(): + self.assertTrue(len(list(self.backend.iter_bills_history(subscription))) > 0) + + def test_downloadbills(self): + """ + Iter all bills and try to download it. + """ for subscription in self.backend.iter_subscription(): - list(self.backend.iter_bills_history(subscription.id)) for bill in self.backend.iter_bills(subscription.id): self.backend.download_bill(bill.id) + + def test_list(self): + """ + Test listing of subscriptions. + """ + subscriptions = list(self.backend.iter_subscription()) + self.assertTrue(len(subscriptions) > 0, msg="Account listing failed")