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:
parent
ad3de2eb3c
commit
ca0db5e400
2 changed files with 11 additions and 5 deletions
|
|
@ -35,9 +35,8 @@ class ComposePage(BasePage):
|
||||||
phone_regex = re.compile('^(\+33|0033|0)(6|7)(\d{8})$')
|
phone_regex = re.compile('^(\+33|0033|0)(6|7)(\d{8})$')
|
||||||
|
|
||||||
def get_nb_remaining_free_sms(self):
|
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')
|
nbSms = self.parser.select(self.document.getroot(), '#freeSms',1).text.strip()
|
||||||
text = self.parser.select(self.document.getroot(), '#smsReminder', 1).text.strip()
|
return nbSms
|
||||||
return remaining_regex.match(text).groupdict().get('nb')
|
|
||||||
|
|
||||||
def post_message(self, message):
|
def post_message(self, message):
|
||||||
receiver = message.thread.id
|
receiver = message.thread.id
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,19 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
from weboob.tools.test import BackendTest
|
from weboob.tools.test import BackendTest
|
||||||
|
|
||||||
|
|
||||||
class SFRTest(BackendTest):
|
class SFRTest(BackendTest):
|
||||||
BACKEND = 'sfr'
|
BACKEND = 'sfr'
|
||||||
|
|
||||||
def test_sfr(self):
|
def test_sfr(self):
|
||||||
pass
|
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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue