Changeset 3919


Ignore:
Timestamp:
Nov 6, 2006, 3:35:16 PM (18 years ago)
Author:
ole
Message:

Automated okushiri validation OK

Location:
anuga_validation/automated_validation_tests/okushiri_tank_validation
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/automated_validation_tests/okushiri_tank_validation/compare_timeseries_with_measures.py

    r3917 r3919  
    2121    plotting = True
    2222
    23 #plotting = False
     23# No plotting for automated unittest (unless one wishes to run
     24# this manually and look at the outputs)
     25plotting = False
     26
    2427
    2528#-------------------------
     
    3942
    4043
    41 # Results from lwru2_variable_mesh.sww
     44# Results from lwru2_variable_mesh.sww (aug 2005)
    4245#
    4346#Validating Boundary
     
    300303        pass
    301304
    302     assert res-eps < expected_covariance[name] < res+eps
     305    assert res-eps <= expected_covariance[name] <= res+eps
    303306   
    304307   
     
    320323
    321324
    322     assert res-eps < expected_difference[name] < res+eps
     325    assert res-eps <= expected_difference[name] <= res+eps
    323326
    324327    # Extrema
     
    337340        pass
    338341
    339     assert res-eps < expected_maximum_diff[name] < res+eps   
     342    assert res-eps <= expected_maximum_diff[name] <= res+eps   
    340343
    341344   
     
    354357        pass
    355358
    356     assert res-eps < expected_minimum_diff[name] < res+eps
     359    assert res-eps <= expected_minimum_diff[name] <= res+eps
    357360   
    358361
     
    374377        pass
    375378   
    376     assert res-eps < expected_argmax_timelag[name] < res+eps
     379    assert res-eps <= expected_argmax_timelag[name] <= res+eps
    377380
    378381    i0 = argmin(observed_timeseries)
     
    391394        pass
    392395
    393     assert res-eps < expected_argmin_timelag[name] < res+eps
     396    assert res-eps <= expected_argmin_timelag[name] <= res+eps
    394397
    395398
  • anuga_validation/automated_validation_tests/okushiri_tank_validation/project.py

    r3916 r3919  
    1717
    1818# Model output
    19 output_filename = 'okushiri_auta_validation.sww'
     19output_filename = 'okushiri_auto_validation.sww'
    2020
    2121
  • anuga_validation/automated_validation_tests/okushiri_tank_validation/validate_okushiri.py

    r3917 r3919  
    33"""
    44
    5 
     5import unittest
    66import os
    77
    8 # FIXME: Make into unit test
    98
    10 # FIXME: Redirect stdout and stderr
     9class Test_Okushiri(unittest.TestCase):
     10    def setUp(self):
    1111
    12 s = 'create_okushiri.py'
    13 os.system('python %s ' %s)
     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               
    1419
    15 s = 'run_okushiri.py'
    16 os.system('python %s ' %s)
     20        #print
     21        s = 'create_okushiri.py'
     22        #print s
     23        res = os.system('python %s > create_okushiri.stdout' %s)
     24        assert res == 0
    1725
    18 s = 'compare_timeseries_with_measures.py'
    19 os.system('python %s ' %s)
     26        s = 'run_okushiri.py'
     27        #print s       
     28        res = os.system('python %s > run_okushiri.stdout' %s)       
     29        assert res == 0
     30       
     31
     32    def tearDown(self):
     33        pass
     34
     35    #def test_creation_of_mesh(self):
     36    #    s = 'create_okushiri.py'
     37    #    os.system('python %s > create_okushiri.stdout' %s)
     38
     39    #def test_that_simulation_can_run(self):
     40    #    s = 'run_okushiri.py'
     41    #    os.system('python %s > run_okushiri.stdout' %s)
     42
     43    def test_that_output_is_as_expected(self):   
     44        s = 'compare_timeseries_with_measures.py'
     45        #print s
     46        res = os.system('python %s > compare_timeseries_with_measures.stdout'\
     47                        %s)
     48        assert res == 0
     49
     50
     51
     52#-------------------------------------------------------------
     53if __name__ == "__main__":
     54    suite = unittest.makeSuite(Test_Okushiri,'test')
     55    runner = unittest.TextTestRunner(verbosity=2)
     56    runner.run(suite)
Note: See TracChangeset for help on using the changeset viewer.