Beispiel #1
0
 def test_header(self):
     tra = ExportTra()
     tra.setHeader('S5', 'CLI', 'JRL', num_dossier='B105ZZ')
     content = tra.render()
     assert position(content, 1, 3) == '***', 'Bad starting record!'
     assert position(content, 4, 2) == 'S5', 'Bad identifiant!'
     assert position(content, 18, 8) == '01011900', 'Default date for "Date Bacule" not found!'
     assert position(content, 26, 8) == '01011900', 'Default date for "Date arrete periodique" not found!'
     assert position(content, 34, 3) == '007'
     assert position(content, 37, 5) == '     '
     assert position(content, 42, 8) == time.strftime('%d%m%Y')
     assert position(content, 128, 6) == 'B105ZZ'
     assert position(content, 145, 3) == '001'
     assert len(content.replace('\r\n', '')) == 147, 'Record length not valid (%d)' % len(content)
Beispiel #2
0
 def test_header(self):
     tra = ExportTra()
     tra.setHeader('S5', 'CLI', 'JRL', num_dossier='B105ZZ')
     content = tra.render()
     assert position(content, 1, 3) == '***', 'Bad starting record!'
     assert position(content, 4, 2) == 'S5', 'Bad identifiant!'
     assert position(
         content, 18,
         8) == '01011900', 'Default date for "Date Bacule" not found!'
     assert position(
         content, 26, 8
     ) == '01011900', 'Default date for "Date arrete periodique" not found!'
     assert position(content, 34, 3) == '007'
     assert position(content, 37, 5) == '     '
     assert position(content, 42, 8) == time.strftime('%d%m%Y')
     assert position(content, 128, 6) == 'B105ZZ'
     assert position(content, 145, 3) == '001'
     assert len(content.replace(
         '\r\n', '')) == 147, 'Record length not valid (%d)' % len(content)
Beispiel #3
0
 def test_header(self):
     tra = ExportTra()
     tra.changeFormat('009')
     tra.setHeader('S5', 'CLI', 'JRL', num_dossier='B105ZZ')
     content = tra.render()
     assert position(content, 34, 3) == '009'
Beispiel #4
0
 def test_header(self):
     tra = ExportTra()
     tra.changeFormat('009')
     tra.setHeader('S5', 'CLI', 'JRL', num_dossier='B105ZZ')
     content = tra.render()
     assert position(content, 34, 3) == '009'