From ca0db5e4008ac79fa1101f1cb8fbf3938b3eeb71 Mon Sep 17 00:00:00 2001 From: blckshrk Date: Sun, 3 Nov 2013 11:43:14 +0100 Subject: [PATCH] Bugs fix and improvement of the coverage. The correction solved the bug on the get_nb_remaining_free_sms() method which does not work correctly. --- modules/sfr/pages/compose.py | 5 ++--- modules/sfr/test.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/sfr/pages/compose.py b/modules/sfr/pages/compose.py index ec767748..f3a9cd21 100644 --- a/modules/sfr/pages/compose.py +++ b/modules/sfr/pages/compose.py @@ -35,9 +35,8 @@ class ComposePage(BasePage): phone_regex = re.compile('^(\+33|0033|0)(6|7)(\d{8})$') def get_nb_remaining_free_sms(self): - remaining_regex = re.compile(u'Il vous reste (?P.+) Texto gratuits vers les numéros SFR à envoyer aujourd\'hui') - text = self.parser.select(self.document.getroot(), '#smsReminder', 1).text.strip() - return remaining_regex.match(text).groupdict().get('nb') + nbSms = self.parser.select(self.document.getroot(), '#freeSms',1).text.strip() + return nbSms def post_message(self, message): receiver = message.thread.id diff --git a/modules/sfr/test.py b/modules/sfr/test.py index c17b980a..22c19f39 100644 --- a/modules/sfr/test.py +++ b/modules/sfr/test.py @@ -17,12 +17,19 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . - from weboob.tools.test import BackendTest - class SFRTest(BackendTest): BACKEND = 'sfr' def test_sfr(self): pass + + def test_create_default_browser(self): + connect = self.backend.create_default_browser() + assert connect + + def test_get_account_status(self): + nbSms = self.backend.get_account_status() + assert nbSms + assert isinstance(nbSms[0].value, str);