Changeset 6782
- Timestamp:
- Apr 14, 2009, 9:55:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/automated_validation_tests/patong_validation/validate_patong.py
r6665 r6782 13 13 import shutil 14 14 15 import project16 15 from anuga.utilities.system_tools import get_web_file, untar_file 17 16 import anuga.utilities.log as log … … 46 45 Check we have required data set in project.py. 47 46 ''' 48 49 # Check that environment variables are defined. 50 if os.getenv(project.ENV_INUNDATIONHOME) is None: 51 msg = ("Environment variable '%s' is not set in project.py" 52 % project.ENV_INUNDATIONHOME) 53 raise Exception, msg 54 55 if os.getenv(project.ENV_MUXHOME) is None: 56 msg = ("Environment variable '%s' is not set in project.py" 57 % project.ENV_MUXHOME) 58 raise Exception, msg 47 48 pass 59 49 60 50 … … 147 137 148 138 # modify environment so we use the local data 149 # INUNDATIONHOME points into the 'data' local data directory150 o ld_inundationhome = os.getenv(project.ENV_INUNDATIONHOME)151 os.putenv(project.ENV_INUNDATIONHOME,152 os.path.join(Local_Data_Directory, ''))153 old_muxhome = os.getenv(project.ENV_MUXHOME) 154 os.putenv(project.ENV_MUXHOME,155 os.path.join(Local_Data_Directory, 'data'))156 139 new_inundationhome = os.path.join(Local_Data_Directory, '') 140 os.environ['INUNDATIONHOME'] = new_inundationhome 141 new_muxhome = os.path.join(Local_Data_Directory, 'data') 142 os.environ['MUXHOME'] = new_muxhome 143 144 # We import here, _after_ environment variables are set 145 import project 146 157 147 # run the simulation, produce SWW file 158 148 log.debug('Running Patong simulation ...') … … 161 151 assert res == 0 162 152 163 # undo environment changes164 if old_inundationhome:165 os.putenv(project.ENV_INUNDATIONHOME, old_inundationhome)166 if old_muxhome:167 os.putenv(project.ENV_MUXHOME, old_muxhome)168 169 170 153 def check_that_output_is_as_expected(): 171 154 '''Check that validation output is as required.'''
Note: See TracChangeset
for help on using the changeset viewer.