Changeset 7766 for trunk/anuga_core/source/anuga/file/test_mux.py
- Timestamp:
- Jun 2, 2010, 1:15:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/file/test_mux.py
r7762 r7766 10 10 from anuga.coordinate_transforms.geo_reference import Geo_reference 11 11 12 from mux import WAVEHEIGHT_MUX_LABEL, EAST_VELOCITY_LABEL, \ 13 NORTH_VELOCITY_LABEL 14 12 15 from mux import WAVEHEIGHT_MUX2_LABEL, EAST_VELOCITY_MUX2_LABEL, \ 13 16 NORTH_VELOCITY_MUX2_LABEL … … 15 18 from mux import read_mux2_py 16 19 from anuga.file_conversion.urs2sts import urs2sts 17 18 class TestCase(unittest.TestCase): 20 from anuga.file.urs import Read_urs 21 22 class Test_Mux(unittest.TestCase): 19 23 def setUp(self): 20 24 pass … … 1487 1491 1488 1492 self.delete_mux(files) 1489 1493 1494 def test_Urs_points(self): 1495 time_step_count = 3 1496 time_step = 2 1497 lat_long_points =[(-21.5,114.5),(-21.5,115),(-21.,115)] 1498 base_name, files = self.write_mux(lat_long_points, 1499 time_step_count, time_step) 1500 for file in files: 1501 urs = Read_urs(file) 1502 assert time_step_count == urs.time_step_count 1503 assert time_step == urs.time_step 1504 1505 for lat_lon, dep in map(None, lat_long_points, urs.lonlatdep): 1506 _ , e, n = redfearn(lat_lon[0], lat_lon[1]) 1507 assert num.allclose(n, dep[2]) 1508 1509 count = 0 1510 for slice in urs: 1511 count += 1 1512 #print slice 1513 for lat_lon, quantity in map(None, lat_long_points, slice): 1514 _ , e, n = redfearn(lat_lon[0], lat_lon[1]) 1515 #print "quantity", quantity 1516 #print "e", e 1517 #print "n", n 1518 if file[-5:] == WAVEHEIGHT_MUX_LABEL[-5:] or \ 1519 file[-5:] == NORTH_VELOCITY_LABEL[-5:] : 1520 assert num.allclose(e, quantity) 1521 if file[-5:] == EAST_VELOCITY_LABEL[-5:]: 1522 assert num.allclose(n, quantity) 1523 assert count == time_step_count 1524 1525 self.delete_mux(files) 1526 1527 1528 1490 1529 1491 1530 ################################################################################ 1492 1531 1493 1532 if __name__ == "__main__": 1494 suite = unittest.makeSuite(Test Case,'test')1533 suite = unittest.makeSuite(Test_Mux,'test') 1495 1534 runner = unittest.TextTestRunner() #verbosity=2) 1496 1535 runner.run(suite)
Note: See TracChangeset
for help on using the changeset viewer.