Skip to content

Commit ace9039

Browse files
author
Hong-Thai Nguyen
committed
Skip 3 chars code in comments
1 parent aed29bb commit ace9039

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cfonb/parser/statement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def parse(self, file_obj):
4949
break
5050
else:
5151
row.update(new_row)
52-
comment = line[46:].strip()
52+
comment = line[46+2:].strip()
5353
if comment:
5454
row['comment'] = row.get('comment', '') + (BR_LINE if row.get('comment', '') else '') + comment
5555
elif line[0:2] == '07':

cfonb/tests/test_statement.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ def test_parse_with_original_content(self):
4949
assert_true(result[0].lines[0].get('origin').startswith('0415589 29701EUR2E01717651230B1230620 220620PRLV AAAAAA 0 0000000000315}VOTRE ABONNEMENT'))
5050
assert_true(result[0].lines[0].get('origin').endswith('0515589 29701EUR2E01717651230B1230620 LIBPRELEVEMENTS SEPA DOMICILIES '))
5151
assert_true(len(result[0].lines[0].get('origin').splitlines()) == 5)
52-
assert_true(len(result[0].lines[0].get('comment').splitlines()) == 4)
52+
comments = result[0].lines[0].get('comment').splitlines()
53+
assert_true(len(comments) == 4)
54+
assert_equal(comments[0], 'XXXXXX')
55+
assert_equal(comments[1], 'VOTRE ABONNEMENT FIXE 02XXXXX896 (FACTURE: XXXXX8960E2) - P')
5356

5457

5558
def suite():

0 commit comments

Comments
 (0)