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

Diff of /trunk/pyvisi/test/python/run_carpet.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_CARPET_IMAGES_PATH = "data_sample_images/carpet/"       PYVISI_WORKDIR=os.environ['PYVISI_WORKDIR']
8    except KeyError:
9         PYVISI_WORKDIR='.'
10    try:
11         PYVISI_TEST_DATA_ROOT=os.environ['PYVISI_TEST_DATA_ROOT']
12    except KeyError:
13         PYVISI_TEST_DATA_ROOT='.'
14        
15    PYVISI_TEST_MESHES_PATH = os.path.join(PYVISI_TEST_DATA_ROOT,"data_meshes")
16    PYVISI_TEST_CARPET_IMAGES_PATH = os.path.join(PYVISI_TEST_DATA_ROOT,"data_sample_images","carpet")
17  MIN_IMAGE_SIZE = 100  MIN_IMAGE_SIZE = 100
18  FILE_3D = "interior_3D.xml"  FILE_3D = "interior_3D.xml"
19    
# Line 34  class TestCarpetScalarWarp(unittest.Test Line 43  class TestCarpetScalarWarp(unittest.Test
43    
44          self.data_collector = DataCollector(source = Source.XML)          self.data_collector = DataCollector(source = Source.XML)
45          self.data_collector.setFileName(file_name = \          self.data_collector.setFileName(file_name = \
46                  PYVISI_TEST_MESHES_PATH + FILE_3D)                  os.path.join(PYVISI_TEST_MESHES_PATH, FILE_3D))
47    
48          self.carpet = Carpet(scene = self.scene,          self.carpet = Carpet(scene = self.scene,
49                  data_collector = self.data_collector,                  data_collector = self.data_collector,
# Line 45  class TestCarpetScalarWarp(unittest.Test Line 54  class TestCarpetScalarWarp(unittest.Test
54      def testScalarWarp(self):      def testScalarWarp(self):
55          self.carpet.setScaleFactor(1)          self.carpet.setScaleFactor(1)
56          self.carpet.setPlaneToXY()          self.carpet.setPlaneToXY()
57          self.render("TestCarpetScalarWarp.jpg")          self.render(os.path.join(PYVISI_WORKDIR,"TestCarpetScalarWarp.jpg"))
58            
59  class TestCarpetVectorWarp(unittest.TestCase, TestCarpet):  class TestCarpetVectorWarp(unittest.TestCase, TestCarpet):
60      def setUp(self):      def setUp(self):
# Line 55  class TestCarpetVectorWarp(unittest.Test Line 64  class TestCarpetVectorWarp(unittest.Test
64    
65          self.data_collector = DataCollector(source = Source.XML)          self.data_collector = DataCollector(source = Source.XML)
66          self.data_collector.setFileName(file_name = \          self.data_collector.setFileName(file_name = \
67                  PYVISI_TEST_MESHES_PATH + FILE_3D)                  os.path.join(PYVISI_TEST_MESHES_PATH, FILE_3D))
68    
69          self.carpet = Carpet(scene = self.scene,          self.carpet = Carpet(scene = self.scene,
70                  data_collector = self.data_collector,                  data_collector = self.data_collector,
# Line 66  class TestCarpetVectorWarp(unittest.Test Line 75  class TestCarpetVectorWarp(unittest.Test
75      def testVectorWarp(self):      def testVectorWarp(self):
76          self.carpet.setScaleFactor(1)          self.carpet.setScaleFactor(1)
77          self.carpet.setPlaneToXY()          self.carpet.setPlaneToXY()
78          self.render("TestCarpetVectorWarp.jpg")          self.render(os.path.join(PYVISI_WORKDIR,"TestCarpetVectorWarp.jpg"))
79            
80    
81    

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

  ViewVC Help
Powered by ViewVC 1.1.26