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.
This commit is contained in:
blckshrk 2013-11-03 11:43:14 +01:00 committed by Florent
commit ca0db5e400
2 changed files with 11 additions and 5 deletions

View file

@ -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<nb>.+) 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