Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore _touchdown_... attributes before resuming function with touchdowns #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions fints/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,24 @@
response = dialog.send(tan_seg)

resume_func = getattr(self, challenge.resume_method)

# Restore _touchdown_... attributes
if challenge.resume_method == '_continue_fetch_with_touchdowns' and challenge.command_seg.TYPE == 'HKKAZ':
self._touchdown_args = ['HIKAZ']
self._touchdown_kwargs = {}
self._touchdown_responses = []
self._touchdown_counter = 1
self._touchdown_dialog = dialog
self._touchdown_response_processor = lambda responses: mt940_to_array(

Check warning on line 1272 in fints/client.py

View check run for this annotation

Codecov / codecov/patch

fints/client.py#L1267-L1272

Added lines #L1267 - L1272 were not covered by tests
''.join([seg.statement_booked.decode('iso-8859-1') for seg in responses]))
hkkaz = self._find_highest_supported_command(HKKAZ5, HKKAZ6, HKKAZ7)
self._touchdown_segment_factory = lambda touchdown: hkkaz(

Check warning on line 1275 in fints/client.py

View check run for this annotation

Codecov / codecov/patch

fints/client.py#L1274-L1275

Added lines #L1274 - L1275 were not covered by tests
account=challenge.command_seg.account,
all_accounts=False,
date_start=challenge.command_seg.date_start,
date_end=challenge.command_seg.date_end,
touchdown_point=touchdown,
)
return resume_func(challenge.command_seg, response)

def _process_response(self, dialog, segment, response):
Expand Down