예제 #1
0
 def test_encoding_write(self):
     mesh = BDF(log=log, debug=False)
     mesh.add_card(['GRID', 100000, 0, 43.91715, -29., .8712984], 'GRID')
     mesh.write_bdf('out.bdf')
     lines_expected = [
         '$pyNastran: version=msc',
         '$pyNastran: punch=True',
         '$pyNastran: encoding=ascii' if PY2 else '$pyNastran: encoding=utf-8\n',
         '$pyNastran: nnodes=1',
         '$pyNastran: nelements=0',
         '$NODES',
         'GRID      100000        43.91715    -29..8712984',
     ]
     bdf_filename = 'out.bdf'
     with codec_open(bdf_filename, 'r', encoding='ascii') as bdf_file:
         lines = bdf_file.readlines()
         compare_lines(self, lines, lines_expected, has_endline=False)
예제 #2
0
 def test_encoding_write(self):
     mesh = BDF(log=log, debug=False)
     mesh.add_card(['GRID', 100000, 0, 43.91715, -29., .8712984], 'GRID')
     mesh.write_bdf('out.bdf')
     lines_expected = [
         '$pyNastran: version=msc',
         '$pyNastran: punch=True',
         '$pyNastran: encoding=ascii'
         if PY2 else '$pyNastran: encoding=utf-8\n',
         '$pyNastran: nnodes=1',
         '$pyNastran: nelements=0',
         '$NODES',
         'GRID      100000        43.91715    -29..8712984',
     ]
     bdf_filename = 'out.bdf'
     with codec_open(bdf_filename, 'r', encoding='ascii') as bdf_file:
         lines = bdf_file.readlines()
         compare_lines(self, lines, lines_expected, has_endline=False)