| Home | Trees | Indices | Help |
|---|
|
|
1 # -*- coding: UTF-8 -*- 2 3 import os 4 from unittest import TestCase 5 from ...testing import loadfile 6 from .. import gambit 79 __test__ = False 10 blk = None 11 str_neu_vtk = None 124114 """ 15 Compare two input strings line by line. 16 """ 17 import sys 18 lines1 = str1.splitlines() 19 lines2 = str2.splitlines() 20 self.assertEqual(len(lines1), len(lines2)) 21 iswin = sys.platform.startswith('win') 22 nlines = len(lines1) 23 i = 0 24 while i < nlines: 25 oline = lines1[i] 26 nline = lines2[i] 27 # compare only non-float lines. 28 if not iswin or 'e' not in oline.lower(): 29 self.assertEqual(oline, nline) 30 i += 13133 import StringIO 34 from .. import vtk 35 outf = StringIO.StringIO() 36 writer = vtk.VtkLegacyUstGridWriter(self.blk) 37 writer.write(outf) 38 str_blk_vtk = outf.getvalue() 39 # compare new result with old result line by line. 40 self.assertLines(self.str_neu_vtk, str_blk_vtk)43 __test__ = True 44 blk = gambit.GambitNeutral(loadfile('sample.neu')).toblock( 45 fpdtype='float32') 46 str_neu_vtk = loadfile('sample.neu.single.vtk')4749 __test__ = True 50 blk = gambit.GambitNeutral(loadfile('sample.neu')).toblock( 51 fpdtype='float64') 52 str_neu_vtk = loadfile('sample.neu.double.vtk')53
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Thu Aug 11 23:04:54 2011 | http://epydoc.sourceforge.net |