mirror of
https://github.com/wassname/simpeg.git
synced 2026-06-27 21:08:35 +08:00
Updated test_MeshIO to remove the temp files after using them.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import numpy as np
|
||||
import unittest
|
||||
import unittest, os
|
||||
import SimPEG as simpeg
|
||||
from SimPEG.Mesh import TensorMesh, TreeMesh
|
||||
|
||||
@@ -29,17 +29,20 @@ class TestOcTreeIO(unittest.TestCase):
|
||||
assert np.sum(vec - vecUBC) == 0
|
||||
assert np.all(np.array(mesh.h) - np.array(meshUBC.h) == 0)
|
||||
print 'IO of UBC octree files is working'
|
||||
os.remove('temp.msh')
|
||||
os.remove('arange.txt')
|
||||
|
||||
def test_VTUfiles(self):
|
||||
mesh = self.mesh
|
||||
vec = np.arange(mesh.nC)
|
||||
try:
|
||||
simpeg.Utils.meshutils.writeVTUFile('test.vtu',mesh,{'arange':vec})
|
||||
simpeg.Utils.meshutils.writeVTUFile('temp.vtu',mesh,{'arange':vec})
|
||||
run = True
|
||||
except:
|
||||
run = False
|
||||
assert run
|
||||
print 'Writing of VTU files is working'
|
||||
os.remove('temp.vtu')
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user