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

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

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

revision 1147 by ksteube, Wed May 16 06:39:11 2007 UTC revision 1148 by jongui, Wed May 16 22:45:33 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_SCENE_IMAGES_PATH = "data_sample_images/scene/"  try:
7        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_SCENE_REFERENCE_IMAGES_PATH = os.path.join(PYVISI_TEST_DATA_ROOT, \
16            "data_reference_images", "scene")
17    PYVISI_TEST_SCENE_IMAGES_PATH = os.path.join(PYVISI_WORKDIR, \
18            "data_sample_images", "scene")
19    
20  MIN_IMAGE_SIZE = 100  MIN_IMAGE_SIZE = 100
21  X_SIZE = 400  X_SIZE = 400
22  Y_SIZE = 400  Y_SIZE = 400
   
23  JPG_RENDERER = Renderer.OFFLINE_JPG  JPG_RENDERER = Renderer.OFFLINE_JPG
24    
25  class TestScene:  class TestScene:
# Line 16  class TestScene: Line 28  class TestScene:
28    
29      def render(self, file):      def render(self, file):
30          self.scene.render(image_name = \          self.scene.render(image_name = \
31                  PYVISI_TEST_SCENE_IMAGES_PATH + file)                  os.path.join(PYVISI_TEST_SCENE_IMAGES_PATH, file))
32    
33          self.failUnless(os.stat(PYVISI_TEST_SCENE_IMAGES_PATH + \          self.failUnless(os.stat(os.path.join(PYVISI_TEST_SCENE_IMAGES_PATH, \
34                  file)[ST_SIZE] > MIN_IMAGE_SIZE)                  file))[ST_SIZE] > MIN_IMAGE_SIZE)
35            
36      def setBackground(self, c):      def setBackground(self, c):
37          self.scene.setBackground(color = c)          self.scene.setBackground(color = c)

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

  ViewVC Help
Powered by ViewVC 1.1.26