Changeset 2305 for inundation/pyvolution/test_data_manager.py
- Timestamp:
- Jan 31, 2006, 12:33:19 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/test_data_manager.py
r2304 r2305 141 141 142 142 143 fid.close() 143 fid.close() 144 144 145 145 146 … … 147 148 def tearDown(self): 148 149 import os 149 #os.remove(self.test_MOST_file) 150 150 for ext in ['_ha.nc', '_ua.nc', '_va.nc', '_e.nc']: 151 #print 'Trying to remove', self.test_MOST_file + ext 152 os.remove(self.test_MOST_file + ext) 151 153 152 154 def test_sww_constant(self): … … 1865 1867 #Done (Ole) - it was because sww2ers didn't close it's sww file 1866 1868 os.remove(sww.filename) 1869 os.remove(self.domain.filename + '_elevation') 1870 os.remove(self.domain.filename + '_elevation.ers') 1867 1871 1868 1872 … … 1891 1895 first_value = fid.variables['HA'][:][0,0,0] 1892 1896 fourth_value = fid.variables['HA'][:][0,0,3] 1897 fid.close() 1893 1898 1894 1899 … … 1930 1935 #Cleanup 1931 1936 import os 1932 #os.remove('small.sww')1933 1937 os.remove(self.test_MOST_file + '.sww') 1934 1938 … … 2232 2236 2233 2237 2234 def test_sww2domain (self):2238 def test_sww2domain1(self): 2235 2239 ################################################ 2236 2240 #Create a test domain, and evolve and save it. … … 2298 2302 ################### 2299 2303 2300 os.remove(domain.filename + '.sww') 2304 #os.remove(domain.filename + '.sww') 2305 os.remove(filename) 2301 2306 2302 2307 bits = ['vertex_coordinates'] … … 2390 2395 domain.visualise = False 2391 2396 domain.store = True 2392 domain.filename = 'bedslope' 2397 domain.set_name('test_file') 2398 domain.set_datadir('.') 2393 2399 domain.default_order=2 2394 2400 domain.quantities_to_be_stored=['stage'] … … 2430 2436 try: 2431 2437 domain2 = sww2domain(filename,boundary,fail_if_NaN=True,verbose=False) 2432 assert True == False2433 2438 except: 2434 2439 #Now import it, filling NaNs to be 0 … … 2436 2441 domain2 = sww2domain(filename,None,fail_if_NaN=False,NaN_filler = filler,verbose=False) 2437 2442 2443 #Clean up 2444 os.remove(filename) 2438 2445 2439 2446 … … 2455 2462 assert min(min(domain2.get_quantity('ymomentum')))==filler 2456 2463 2457 #print 'passed'2458 2459 #FIXME (DSG-all) this doesn't work (in windows), due to permitions2460 #it the file is created in the temp area this problem2461 # might be avoided2462 2463 #cleanup2464 #import os2465 #os.remove(domain.datadir+'/'+domain.filename+'.sww')2466 for filename in os.listdir('.'):2467 if filename.endswith('sww'):2468 print filename2469 os.remove(domain.filename + '.sww')2470 2464 2471 2465
Note: See TracChangeset
for help on using the changeset viewer.