- Timestamp:
- Jun 11, 2010, 11:42:42 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/utilities/test_file_utils.py
r7780 r7820 6 6 from anuga.utilities.file_utils import copy_code_files, get_all_swwfiles 7 7 from anuga.utilities.file_utils import del_dir 8 from sww_merge import sww_merge 8 9 9 10 … … 109 110 assert len(iterate)==4 110 111 112 def test_merge_swwfiles(self): 113 from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular, \ 114 rectangular_cross 115 from anuga.shallow_water.shallow_water_domain import Domain 116 from anuga.file.sww import SWW_file 117 from anuga.abstract_2d_finite_volumes.generic_boundary_conditions import \ 118 Dirichlet_boundary 119 120 Bd = Dirichlet_boundary([0.5, 0., 0.]) 121 122 # Create shallow water domain 123 domain = Domain(*rectangular_cross(2, 2)) 124 domain.set_name('test1') 125 domain.set_quantity('elevation', 2) 126 domain.set_quantity('stage', 5) 127 domain.set_boundary({'left': Bd, 'right': Bd, 'top': Bd, 'bottom': Bd}) 128 for t in domain.evolve(yieldstep=0.5, finaltime=1): 129 pass 130 131 domain = Domain(*rectangular(3, 3)) 132 domain.set_name('test2') 133 domain.set_quantity('elevation', 3) 134 domain.set_quantity('stage', 50) 135 domain.set_boundary({'left': Bd, 'right': Bd, 'top': Bd, 'bottom': Bd}) 136 for t in domain.evolve(yieldstep=0.5, finaltime=1): 137 pass 138 139 outfile = 'test_out.sww' 140 sww_merge(['test1.sww', 'test2.sww'], outfile) 141 self.failUnless(os.access(outfile, os.F_OK)) 142 143 # remove temp files 144 os.remove('test1.sww') 145 os.remove('test2.sww') 146 # os.remove(outfile) 147 148 149 111 150 #------------------------------------------------------------- 112 151 113 152 if __name__ == "__main__": 114 #suite = unittest.makeSuite(Test_Data_Manager, 'test_sww2domain2') 115 suite = unittest.makeSuite(Test_FileUtils, 'test_sww') 153 suite = unittest.makeSuite(Test_FileUtils, 'test') 116 154 runner = unittest.TextTestRunner() #verbosity=2) 117 155 runner.run(suite)
Note: See TracChangeset
for help on using the changeset viewer.