/[escript]/trunk/pyvisi/test/python/run_contour.py
ViewVC logotype

Diff of /trunk/pyvisi/test/python/run_contour.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1137 by jongui, Thu Mar 29 04:20:50 2007 UTC revision 1138 by gross, Mon May 14 04:15:04 2007 UTC
# Line 3  from esys.pyvisi.constant import * Line 3  from esys.pyvisi.constant import *
3  import unittest, os  import unittest, os
4  from stat import ST_SIZE  from stat import ST_SIZE
5    
6  PYVISI_TEST_MESHES_PATH = "data_meshes/"  try:
7  PYVISI_TEST_CONTOUR_IMAGES_PATH = "data_sample_images/contour/"       PYVISI_WORKDIR=os.environ['PYVISI_WORKDIR']
8    except KeyError:
9         PYVISI_WORKDIR='.'
10    
11    try:
12         PYVISI_TEST_DATA_ROOT=os.environ['PYVISI_TEST_DATA_ROOT']
13    except KeyError:
14         PYVISI_TEST_DATA_ROOT='.'
15    
16    
17        
18    PYVISI_TEST_MESHES_PATH = os.path.join(PYVISI_TEST_DATA_ROOT,"data_meshes")
19    PYVISI_TEST_CONTOUR_IMAGES_PATH = os.path.join(PYVISI_TEST_DATA_ROOT, "data_sample_images","contour")
20  MIN_IMAGE_SIZE = 100  MIN_IMAGE_SIZE = 100
21  FILE_2D = "interior_2D.xml"  FILE_2D = "interior_2D.xml"
22    
# Line 21  class TestContour(unittest.TestCase): Line 33  class TestContour(unittest.TestCase):
33    
34          self.data_collector = DataCollector(source = Source.XML)          self.data_collector = DataCollector(source = Source.XML)
35          self.data_collector.setFileName(file_name = \          self.data_collector.setFileName(file_name = \
36                  PYVISI_TEST_MESHES_PATH + FILE_2D)                  os.path.join(PYVISI_TEST_MESHES_PATH,FILE_2D))
37    
38          self.contour = Contour(scene = self.scene,          self.contour = Contour(scene = self.scene,
39                  data_collector = self.data_collector,                  data_collector = self.data_collector,
# Line 35  class TestContour(unittest.TestCase): Line 47  class TestContour(unittest.TestCase):
47    
48      def render(self, file):      def render(self, file):
49          self.scene.render(image_name = \          self.scene.render(image_name = \
50          PYVISI_TEST_CONTOUR_IMAGES_PATH + file)          os.path.join(PYVISI_TEST_CONTOUR_IMAGES_PATH ,file))
51    
52          self.failUnless(os.stat(PYVISI_TEST_CONTOUR_IMAGES_PATH + \          self.failUnless(os.stat(os.path.join(PYVISI_TEST_CONTOUR_IMAGES_PATH ,file))[ST_SIZE] > MIN_IMAGE_SIZE)
                 file)[ST_SIZE] > MIN_IMAGE_SIZE)  
53    
54      def testGenerateContours(self):      def testGenerateContours(self):
55          self.contour.generateContours(5)          self.contour.generateContours(5)

Legend:
Removed from v.1137  
changed lines
  Added in v.1138

  ViewVC Help
Powered by ViewVC 1.1.26