示例#1
0
 def test_SAT_export(self):
     tra = ExportTra()
     tra.setHeader('S5', 'CLI', 'JRL')
     tra.addSAT('PROJ1', 'Projet1', 'Axe1')
     content = tra._content['lines'][0]
     assert content[:3] == '***', 'Bad starting record!'
     assert len(content) == 251, 'SAT Line in 007 format must containt 251 characters'
     assert content[248:] == 'M  ', 'Sens field must be set with M by default'
示例#2
0
 def test_SAT_mandatory(self):
     try:
         tra = ExportTra()
         tra.setHeader('S5', 'CLI', 'JRL')
         tra.addSAT('PROJ1', 'Projet1')
         pytest.fail('Axe content is mandatory, missing value must be raise and error')
     except MandatoryException:
         pass
示例#3
0
 def test_SAT_mandatory(self):
     try:
         tra = ExportTra()
         tra.setHeader('S5', 'CLI', 'JRL')
         tra.addSAT('PROJ1', 'Projet1')
         pytest.fail(
             'Axe content is mandatory, missing value must be raise and error'
         )
     except MandatoryException:
         pass
示例#4
0
 def test_SAT_export(self):
     tra = ExportTra()
     tra.setHeader('S5', 'CLI', 'JRL')
     tra.addSAT('PROJ1', 'Projet1', 'Axe1')
     content = tra._content['lines'][0]
     assert content[:3] == '***', 'Bad starting record!'
     assert len(
         content
     ) == 251, 'SAT Line in 007 format must containt 251 characters'
     assert content[
         248:] == 'M  ', 'Sens field must be set with M by default'