Skip to content

Commit 6b01f58

Browse files
author
Hong-Thai Nguyen
committed
Fix save return line on origin version
1 parent 39a95ff commit 6b01f58

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

cfonb/tests/test_statement.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_parse_with_original_content(self):
4848
assert_equal(len(result[0].lines), 1)
4949
assert_true(result[0].lines[0].get('origin').startswith('0415589 29701EUR2E01711467640B1230620 220620PRLV ORANGE 0 0000000000315}VOTRE ABONNEMENT'))
5050
assert_true(result[0].lines[0].get('origin').endswith('0515589 29701EUR2E01711467640B1230620 LIBPRELEVEMENTS SEPA DOMICILIES '))
51+
assert_true(len(result[0].lines[0].get('origin').splitlines()) == 5)
5152

5253

5354
def suite():

cfonb/tests/test_transfert.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@
66
from cfonb.writer import transfert as w
77

88

9-
def _print(res):
10-
print(res.replace('\r\n','\\r\\n').replace(' ','.'))
11-
12-
139
class TestTransfert(unittest.TestCase):
1410

1511
def test_empty_file(self):
1612
d = date(2011,10,14)
1713
a = w.Transfert()
1814
a.setEmeteurInfos('2000121','bigbrother','virement de test',503103,2313033,1212,d)
1915
res = a.render()
20-
want = '0302 200012 14101bigbrother viremen E 503102313033 1212 \r\n0802 200012 0000000000000000 \r\n'
16+
want = '''0302 200012 141011bigbrother viremen E 503102313033 1212
17+
0802 200012 0000000000000000
18+
'''
2119
assert res == want
2220

2321
def test_one_line(self):
@@ -26,9 +24,10 @@ def test_one_line(self):
2624
a.setEmeteurInfos('2000121','bigbrother','virement de test',503103,2313033,1212,d)
2725
a.add('un test','littlebrother','credit agricole ile de france',50011,6565329000,100,'un peu d\'argent',6335)
2826
res = a.render()
29-
want = '0302 200012 14101bigbrother viremen E 503102313033 1212 \r\n0602 200012un test littlebrother credit agricole ile de f 50011656530000000000010000un peu d\'argent 6335 \r\n0802 200012 0000000000010000 \r\n'
30-
# _print(res)
31-
# _print(want)
27+
want = '''0302 200012 141011bigbrother viremen E 503102313033 1212
28+
0602 200012un test littlebrother credit agricole ile de f 50011656530000000000010000un peu d'argent 6335
29+
0802 200012 0000000000010000
30+
'''
3231
assert res == want
3332

3433

cfonb/writer/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
BR_LINE = '\r\n'
1+
BR_LINE = '\n'
22

33

44
def write(input_, length, rpad=False, fill_char=' '):

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import setup, find_packages
22

3-
version = '2.2'
3+
version = '2.3'
44

55
long_description = open('README.rst').read()
66

@@ -14,7 +14,7 @@
1414
author='Dhatim',
1515
author_email='[email protected]',
1616
url='https://github.com/dhatim/python-cfonb',
17-
download_url = 'https://github.com/dhatim/python-cfonb/archive/2.2.tar.gz',
17+
download_url = 'https://github.com/dhatim/python-cfonb/archive/2.3.tar.gz',
1818
license='LGPL',
1919
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
2020
include_package_data=True,

0 commit comments

Comments
 (0)