source: anuga_validation/automated_validation_tests/okushiri_tank_validation/validate_okushiri.py @ 4783

Last change on this file since 4783 was 4783, checked in by duncan, 16 years ago

modified to aid in debugging

File size: 1.9 KB
Line 
1"""Automatic verification that the ANUGA code validates against the okushiri
2dataset as expected. See anuga_validation/okushiri_2005 for more details
3"""
4
5import unittest
6import os
7
8
9class Test_Okushiri(unittest.TestCase):
10    def setUp(self):
11       
12        # Remove garbage
13        for file in os.listdir('.'):
14            if file.endswith('.stdout') or\
15               file.endswith('.sww') or\
16               file.endswith('.msh'):
17                os.remove(file)
18               
19       
20    def tearDown(self):
21        pass
22
23    def test_that_output_is_as_expected(self):
24
25        #print
26        s = 'create_okushiri.py'
27        #print s
28        res = os.system('python %s > create_okushiri.stdout' %s)
29        assert res == 0
30
31        s = 'run_okushiri.py'
32        #print s       
33        res = os.system('python %s > run_okushiri.stdout' %s)       
34        assert res == 0
35        s = 'compare_timeseries_with_measures.py'
36        #print s
37        res = os.system('python %s > compare_timeseries_with_measures.stdout'\
38                        %s)
39        assert res == 0
40
41    def manual_test_that_output_is_as_expected(self):
42        from run_okushiri import main
43        from create_okushiri import create_mesh
44
45        # Note, this has not been tested when code is failing.
46        # Next step, use the parrameter elevation_in_mesh
47        # and only run create_okishiri once for speed.
48       
49        res = create_mesh()
50        assert res == None
51       
52        res = main()
53        assert res == None
54       
55        s = 'compare_timeseries_with_measures.py'
56        #print s
57        res = os.system('python %s > compare_timeseries_with_measures.stdout'\
58                        %s)
59        assert res == 0
60       
61
62#-------------------------------------------------------------
63if __name__ == "__main__":
64    suite = unittest.makeSuite(Test_Okushiri,'test')
65    runner = unittest.TextTestRunner(verbosity=2)
66    runner.run(suite)
Note: See TracBrowser for help on using the repository browser.