[MOAB-dev] r2903 - in MOAB/trunk/tools/iMesh/python: . test
jvporter at wisc.edu
jvporter at wisc.edu
Thu May 21 13:05:55 CDT 2009
Author: jvporter
Date: 2009-05-21 13:05:53 -0500 (Thu, 21 May 2009)
New Revision: 2903
Modified:
MOAB/trunk/tools/iMesh/python/iMesh.c
MOAB/trunk/tools/iMesh/python/test/basic.py
Log:
Fix issues with creation of temp file for Python interface test
Modified: MOAB/trunk/tools/iMesh/python/iMesh.c
===================================================================
--- MOAB/trunk/tools/iMesh/python/iMesh.c 2009-05-20 20:42:54 UTC (rev 2902)
+++ MOAB/trunk/tools/iMesh/python/iMesh.c 2009-05-21 18:05:53 UTC (rev 2903)
@@ -271,7 +271,7 @@
else
outer = size;
/* TODO: think about this */
- npy_intp dims[] = {outer,coords_size/outer};
+ npy_intp dims[] = {outer, coords_size/outer};
return PyArray_NewFromMalloc(2,dims,NPY_DOUBLE,coords);
}
else if(iBaseEntity_Check(obj))
@@ -1010,7 +1010,6 @@
}
else /* iBase_BYTES */
{
- /* TODO: I have no idea if this is right */
data_arr = PyArray_FROMANY(data_obj,NPY_BYTE,1,1,NPY_C_CONTIGUOUS);
if(data_arr == NULL)
return NULL;
Modified: MOAB/trunk/tools/iMesh/python/test/basic.py
===================================================================
--- MOAB/trunk/tools/iMesh/python/test/basic.py 2009-05-20 20:42:54 UTC (rev 2902)
+++ MOAB/trunk/tools/iMesh/python/test/basic.py 2009-05-21 18:05:53 UTC (rev 2903)
@@ -1,4 +1,5 @@
from core import *
+import tempfile
class TestBasic(unittest.TestCase):
def testMinimal(self):
@@ -72,15 +73,17 @@
self.assertEqual(mesh.getNumOfTopo(root, topo.line_segment), 2)
def testSave(self):
+ file = tempfile.NamedTemporaryFile()
+
mesh = iMesh()
verts = [1,2,3]
mesh.createVtx(verts)
- mesh.save(mesh.rootSet,'test')
+ mesh.save(mesh.rootSet,file.name)
mesh = iMesh()
root = mesh.rootSet
- mesh.load(root,'test')
+ mesh.load(root,file.name)
ents = mesh.getEntities(root,iBase.type.all,iMesh.topology.all)
self.assertEqual(mesh.getNumOfType(root, iBase.type.vertex), 1)
More information about the moab-dev
mailing list