Commit 6fde9f98 authored by Maxime Pommier's avatar Maxime Pommier Committed by Romain Bignon

[societegenerale] Handle the fact that some loans doesn't show their history yet

parent 87778a7c
Pipeline #2590 passed with stages
in 14 minutes and 57 seconds
......@@ -68,9 +68,10 @@ class JsonBasePage(LoggedPage, JsonPage):
conditions = (
'pas encore géré' in reason, # this page is not handled by SG api website
'le service est momentanement indisponible' in reason, # can't access new website
'le service est momentanement indisponible' in reason, # can't access new website
)
assert any(conditions), 'Error %s is not handled yet' % reason
self.logger.warning('Handled Error "%s"', reason)
class AccountsMainPage(LoggedPage, HTMLPage):
......@@ -465,6 +466,11 @@ class HistoryPage(JsonBasePage):
@pagination
@method
class iter_history(DictElement):
def condition(self):
# If we reach this point and it's "NOK", that's mean it's a known error handled
# in JsonBasePage and we can't have history for now.
return Dict('commun/statut')(self.el).upper() != 'NOK'
def next_page(self):
return self.page.hist_pagination('history')
......@@ -512,6 +518,11 @@ class HistoryPage(JsonBasePage):
@pagination
@method
class iter_intraday_comings(DictElement):
def condition(self):
# If we reach this point and it's "NOK", that mean it's a known error handled
# in JsonBasePage and we can't have history for now.
return Dict('commun/statut')(self.el).upper() != 'NOK'
def next_page(self):
return self.page.hist_pagination('intraday')
......
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