casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
accum_test.py
Go to the documentation of this file.
00001 ########################################################################
00002 #       This script will call the main regression script               #
00003 #       accum_regression.py. The returned data set from                #
00004 #       is copied by the runTest() method to the working               #
00005 #       directory, defaulted to /tmp.                                  #
00006 #       Exceptions will be handled if accum() fails to run or if       #
00007 #       the regression tests do not pass.                              #
00008 #                                                                      #
00009 ########################################################################
00010 
00011 import sys
00012 import os
00013 import string
00014 from locatescript import copydata
00015 from locatescript import locatescript
00016 import inspect
00017 
00018 a=inspect.stack()
00019 stacklevel=0
00020 for k in range(len(a)):
00021     if (string.find(a[k][1], 'ipython console') > 0):
00022         stacklevel=k
00023         break
00024 gl=sys._getframe(stacklevel).f_globals
00025 
00026 def description():
00027     return "Based on accum_regression.py"
00028 
00029 def data():
00030     ### return the data files that is needed by the regression script
00031     return ['ngc5921.fits']
00032 #    return []
00033 
00034 def run( fetch=False ):
00035 
00036     #####fetch data
00037     if fetch:
00038         for f in data( ):
00039             copydata( f, os.getcwd( ) )
00040     
00041     #####locate the regression script
00042     lepath=locatescript('accum_regression.py')
00043     gl['regstate']=True
00044     execfile(lepath, gl)
00045     print 'regstate =', gl['regstate']
00046     if not gl['regstate']:
00047         raise Exception, 'regstate = False'
00048 
00049     return []