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

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

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

revision 1148 by jongui, Wed May 16 22:45:33 2007 UTC revision 1381 by gross, Wed Jan 9 07:59:15 2008 UTC
# Line 1  Line 1 
1  from esys.pyvisi import Scene, ImageReader, Logo  from esys.pyvisi import Scene, ImageReader, Logo
2  from esys.pyvisi import LocalPosition  from esys.pyvisi import LocalPosition
3  from esys.pyvisi.constant import *  from esys.pyvisi.constant import *
4  import unittest, os  import unittest, os, sys
5  from stat import ST_SIZE  from stat import ST_SIZE
6    
7  try:  try:
# Line 14  except KeyError: Line 14  except KeyError:
14      PYVISI_TEST_DATA_ROOT='.'      PYVISI_TEST_DATA_ROOT='.'
15    
16  PYVISI_TEST_MESHES_PATH = os.path.join(PYVISI_TEST_DATA_ROOT, "data_meshes")  PYVISI_TEST_MESHES_PATH = os.path.join(PYVISI_TEST_DATA_ROOT, "data_meshes")
 PYVISI_TEST_LOGO_REFERENCE_IMAGES_PATH = os.path.join(PYVISI_TEST_DATA_ROOT, \  
         "data_reference_images", "logo")  
17  PYVISI_TEST_LOGO_IMAGES_PATH = os.path.join(PYVISI_WORKDIR, \  PYVISI_TEST_LOGO_IMAGES_PATH = os.path.join(PYVISI_WORKDIR, \
18          "data_sample_images", "logo")          "data_sample_images", "logo")
19    
# Line 26  Y_SIZE = 400 Line 24  Y_SIZE = 400
24  JPG_RENDERER = Renderer.OFFLINE_JPG  JPG_RENDERER = Renderer.OFFLINE_JPG
25    
26  class TestLogoWithLazyEvaluation:  class TestLogoWithLazyEvaluation:
     def tearDown(self):  
         self.scene  
   
27      def render(self, file):      def render(self, file):
28          self.scene.render(image_name = \          self.scene.render(image_name = \
29                  os.path.join(PYVISI_TEST_LOGO_IMAGES_PATH, file))                  os.path.join(PYVISI_TEST_LOGO_IMAGES_PATH, file))
# Line 37  class TestLogoWithLazyEvaluation: Line 32  class TestLogoWithLazyEvaluation:
32                  file))[ST_SIZE] > MIN_IMAGE_SIZE)                  file))[ST_SIZE] > MIN_IMAGE_SIZE)
33    
34  class TestLogo(unittest.TestCase, TestLogoWithLazyEvaluation):  class TestLogo(unittest.TestCase, TestLogoWithLazyEvaluation):
35        def tearDown(self):
36            del self.scene
37    
38      def testLogo(self):      def testLogo(self):
39    
40          # Create a Scene.          # Create a Scene.
# Line 65  class TestLogo(unittest.TestCase, TestLo Line 63  class TestLogo(unittest.TestCase, TestLo
63  if __name__ == '__main__':  if __name__ == '__main__':
64      suite = unittest.TestSuite()      suite = unittest.TestSuite()
65      suite.addTest(unittest.TestLoader().loadTestsFromTestCase(TestLogo))      suite.addTest(unittest.TestLoader().loadTestsFromTestCase(TestLogo))
66      unittest.TextTestRunner(verbosity=2).run(suite)      s=unittest.TextTestRunner(verbosity=2).run(suite)
67            if not s.wasSuccessful(): sys.exit(1)
68    

Legend:
Removed from v.1148  
changed lines
  Added in v.1381

  ViewVC Help
Powered by ViewVC 1.1.26