fixes on fortuneo module

browser.py:
        added condition on login page
        test in home removed
    pages/accounts_list.py
        code  refactor
        BrokenPageError is thrown if the <tr> table is void
        cosmetic changes
        added a TODO for FrenchTransaction implementation
        not needed code lines deleted
        list concatenation in a smarter way
    pages/login.py
        BrowserUnavailable() implemented to throw an exception when the site is in maintenance
        smarter list concatenation
    test.py
        working test (was not really implemented)
This commit is contained in:
sputnick 2012-04-21 19:01:42 +02:00 committed by Romain Bignon
commit cd5f29a0f9
4 changed files with 27 additions and 24 deletions

View file

@ -20,16 +20,25 @@
#from logging import error
from weboob.tools.browser import BasePage #, BrowserUnavailable
from weboob.tools.browser import BasePage, BrowserUnavailable
__all__ = ['LoginPage']
class LoginPage(BasePage):
def login(self, login, passwd):
def login(self, login, passwd):
msgb = self.document.xpath(".//*[@id='message_client']/text()")
msga = ''.join(msgb)
msg = msga.strip("\n")
if "maintenance" in msg:
print "Fortuneo: "+msg
raise BrowserUnavailable(msg)
self.browser.select_form(nr=3)
self.browser['login'] = login
self.browser['passwd'] = passwd
self.browser.submit()
# vim:ts=4:sw=4