Commit 60dfff3b authored by Florian Duguet's avatar Florian Duguet Committed by Romain Bignon

[ameli] handle unavailable page

Closes: 14247@sibi
parent 8cae8ee2
...@@ -21,8 +21,11 @@ from __future__ import unicode_literals ...@@ -21,8 +21,11 @@ from __future__ import unicode_literals
from weboob.browser import LoginBrowser, URL, need_login from weboob.browser import LoginBrowser, URL, need_login
from weboob.exceptions import BrowserIncorrectPassword, ActionNeeded from weboob.exceptions import BrowserIncorrectPassword, ActionNeeded
from .pages import (
LoginPage, HomePage, CguPage, AccountPage, LastPaymentsPage, PaymentsPage, PaymentDetailsPage, Raw, UnavailablePage,
)
from weboob.tools.compat import basestring from weboob.tools.compat import basestring
from .pages import LoginPage, HomePage, CguPage, AccountPage, LastPaymentsPage, PaymentsPage, PaymentDetailsPage, Raw
__all__ = ['AmeliBrowser'] __all__ = ['AmeliBrowser']
...@@ -38,6 +41,7 @@ class AmeliBrowser(LoginBrowser): ...@@ -38,6 +41,7 @@ class AmeliBrowser(LoginBrowser):
paymentdetailsp = URL(r'/PortailAS/paiements.do\?actionEvt=chargerDetailPaiements.*', PaymentDetailsPage) paymentdetailsp = URL(r'/PortailAS/paiements.do\?actionEvt=chargerDetailPaiements.*', PaymentDetailsPage)
lastpaymentsp = URL(r'/PortailAS/paiements.do\?actionEvt=afficherPaiements.*', LastPaymentsPage) lastpaymentsp = URL(r'/PortailAS/paiements.do\?actionEvt=afficherPaiements.*', LastPaymentsPage)
pdf_page = URL(r'PortailAS/PDFServletReleveMensuel.dopdf\?PDF.moisRecherche=.*', Raw) pdf_page = URL(r'PortailAS/PDFServletReleveMensuel.dopdf\?PDF.moisRecherche=.*', Raw)
unavailablep = URL(r'/vu/INDISPO_COMPTE_ASSURES.html', UnavailablePage)
def do_login(self): def do_login(self):
self.logger.debug('call Browser.do_login') self.logger.debug('call Browser.do_login')
......
...@@ -27,9 +27,11 @@ from weboob.browser.filters.html import Attr, XPathNotFound ...@@ -27,9 +27,11 @@ from weboob.browser.filters.html import Attr, XPathNotFound
from weboob.browser.pages import HTMLPage, RawPage, LoggedPage from weboob.browser.pages import HTMLPage, RawPage, LoggedPage
from weboob.capabilities.bill import Subscription, Detail, Bill from weboob.capabilities.bill import Subscription, Detail, Bill
from weboob.browser.filters.standard import CleanText, Regexp from weboob.browser.filters.standard import CleanText, Regexp
from weboob.exceptions import BrowserUnavailable
# Ugly array to avoid the use of french locale # Ugly array to avoid the use of french locale
FRENCH_MONTHS = ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'] FRENCH_MONTHS = ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre']
...@@ -229,3 +231,8 @@ class PaymentDetailsPage(AmeliBasePage): ...@@ -229,3 +231,8 @@ class PaymentDetailsPage(AmeliBasePage):
class Raw(LoggedPage, RawPage): class Raw(LoggedPage, RawPage):
pass pass
class UnavailablePage(HTMLPage):
def on_load(self):
raise BrowserUnavailable(CleanText('//span[@class="texte-indispo"]')(self.doc))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment