Changeset 9566


Ignore:
Timestamp:
Jan 31, 2015, 11:47:13 PM (9 years ago)
Author:
steve
Message:

Changed test folders to tests and added testers to all the sub packages so that
you can do something like anuga.file.test()

Location:
trunk/anuga_core/source
Files:
1 deleted
33 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/tests/test_quantity.py

    r9562 r9566  
    10261026        indices = inside_polygon(quantity.domain.get_vertex_coordinates(),
    10271027                                 polygon)
    1028         points = take(quantity.domain.get_vertex_coordinates(), indices)
     1028        points = num.take(quantity.domain.get_vertex_coordinates(), indices)
    10291029       
    10301030        answer = linear_function(points)
     
    10341034
    10351035        # Check vertices in polygon have been set
    1036         assert num.allclose(take(quantity.vertex_values.flat, indices),
     1036        assert num.allclose(num.take(quantity.vertex_values.flat, indices),
    10371037                            answer)
    10381038
     
    10401040        indices = outside_polygon(quantity.domain.get_vertex_coordinates(),
    10411041                                  polygon)       
    1042         assert num.allclose(take(quantity.vertex_values.flat, indices),
     1042        assert num.allclose(num.take(quantity.vertex_values.flat, indices),
    10431043                            0.0)       
    10441044
     
    11621162        os.remove(txt_file)
    11631163         
    1164     def test_set_values_from_lat_long(self):
     1164    def test_set_values_from_lat_long_2(self):
    11651165        quantity = Quantity(self.mesh_onslow)
    11661166
  • trunk/anuga_core/source/anuga/caching/caching.py

    r9551 r9566  
    464464      set_option('compression', compression)
    465465    except:
    466       log_test_error('Set option failed')     
     466      logtesterror('Set option failed')     
    467467
    468468  try:
     
    506506    Depfile.write('We are the knights who say NI!')
    507507    Depfile.close()
    508     log_test_OK('Wrote file %s' %DepFN)
     508    logtestOK('Wrote file %s' %DepFN)
    509509  except:
    510     log_test_error('Could not open file %s for writing - check your environment' \
     510    logtesterror('Could not open file %s for writing - check your environment' \
    511511               % DepFN)
    512512
     
    516516    set_option('savestat',0)
    517517    assert(options['savestat'] == 0)
    518     log_test_OK('Set option')
     518    logtestOK('Set option')
    519519  except:
    520     log_test_error('Set option failed')   
     520    logtesterror('Set option failed')   
    521521   
    522522  # Make some test input arguments
     
    545545                   verbose=verbose, compression=comp)
    546546      if comp:                   
    547         log_test_OK('Caching evaluation with compression')
     547        logtestOK('Caching evaluation with compression')
    548548      else:     
    549         log_test_OK('Caching evaluation without compression')     
     549        logtestOK('Caching evaluation without compression')     
    550550    except:
    551551      if comp:
    552         log_test_error('Caching evaluation with compression failed - try caching.test(compression=0)')
     552        logtesterror('Caching evaluation with compression failed - try caching.test(compression=0)')
    553553      else:
    554         log_test_error('Caching evaluation failed - try caching.test(verbose=1)')
     554        logtesterror('Caching evaluation failed - try caching.test(verbose=1)')
    555555
    556556    # Retrieve
     
    561561
    562562      if comp:                   
    563         log_test_OK('Caching retrieval with compression')
     563        logtestOK('Caching retrieval with compression')
    564564      else:     
    565         log_test_OK('Caching retrieval without compression')     
     565        logtestOK('Caching retrieval without compression')     
    566566    except:
    567567      if comp:
    568         log_test_error('Caching retrieval with compression failed - try caching.test(compression=0)')
     568        logtesterror('Caching retrieval with compression failed - try caching.test(compression=0)')
    569569      else:                                     
    570         log_test_error('Caching retrieval failed - try caching.test(verbose=1)')
     570        logtesterror('Caching retrieval failed - try caching.test(verbose=1)')
    571571
    572572    # Reference result
     
    576576    if T1 == T2 and T2 == T3:
    577577      if comp:
    578         log_test_OK('Basic caching functionality (with compression)')
     578        logtestOK('Basic caching functionality (with compression)')
    579579      else:
    580         log_test_OK('Basic caching functionality (without compression)')
     580        logtestOK('Basic caching functionality (without compression)')
    581581    else:
    582       log_test_error('Cached result does not match computed result')
     582      logtesterror('Cached result does not match computed result')
    583583
    584584
     
    589589                 return_filename=1)   
    590590    assert(FN[:2] == 'f[')
    591     log_test_OK('Return of cache filename')
     591    logtestOK('Return of cache filename')
    592592  except:
    593     log_test_error('Return of cache filename failed')
     593    logtesterror('Return of cache filename failed')
    594594
    595595  # Test existence of cachefiles
     
    599599    (argsfile,compressed1) = myopen(CD+FN+'_'+file_types[1],"rb",compression)
    600600    (admfile,compressed2) =  myopen(CD+FN+'_'+file_types[2],"rb",compression)
    601     log_test_OK('Presence of cache files')
     601    logtestOK('Presence of cache files')
    602602    datafile.close()
    603603    argsfile.close()
    604604    admfile.close()
    605605  except:
    606     log_test_error('Expected cache files did not exist')
     606    logtesterror('Expected cache files did not exist')
    607607             
    608608  # Test 'test' function when cache is present
     
    614614    assert(T1 == T4)
    615615
    616     log_test_OK("Option 'test' when cache file present")
     616    logtestOK("Option 'test' when cache file present")
    617617  except:
    618     log_test_error("Option 'test' when cache file present failed")     
     618    logtesterror("Option 'test' when cache file present failed")     
    619619
    620620  # Test that 'clear' works
     
    622622  #try:
    623623  #  cache(f,'clear',verbose=verbose)
    624   #  log_test_OK('Clearing of cache files')
     624  #  logtestOK('Clearing of cache files')
    625625  #except:
    626   #  log_test_error('Clear does not work')
     626  #  logtesterror('Clear does not work')
    627627  try:
    628628    cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, clear=1)   
    629     log_test_OK('Clearing of cache files')
     629    logtestOK('Clearing of cache files')
    630630  except:
    631     log_test_error('Clear does not work') 
     631    logtesterror('Clear does not work') 
    632632
    633633 
     
    638638    T4 = cache(f,(a,b,c,N), {'x':x, 'y':y}, verbose=verbose, test=1)
    639639    assert(T4 is None)
    640     log_test_OK("Option 'test' when cache absent")
     640    logtestOK("Option 'test' when cache absent")
    641641  except:
    642     log_test_error("Option 'test' when cache absent failed")     
     642    logtesterror("Option 'test' when cache absent failed")     
    643643         
    644644  # Test dependencies
     
    650650                       
    651651  if T1 == T2:
    652     log_test_OK('Basic dependencies functionality')
     652    logtestOK('Basic dependencies functionality')
    653653  else:
    654     log_test_error('Dependencies do not work')
     654    logtesterror('Dependencies do not work')
    655655
    656656  # Test basic wildcard dependency
     
    660660   
    661661  if T1 == T3:
    662     log_test_OK('Basic dependencies with wildcard functionality')
     662    logtestOK('Basic dependencies with wildcard functionality')
    663663  else:
    664     log_test_error('Dependencies with wildcards do not work')
     664    logtesterror('Dependencies with wildcards do not work')
    665665
    666666
     
    676676 
    677677  if T3 is None:
    678     log_test_OK('Changed dependencies recognised')
     678    logtestOK('Changed dependencies recognised')
    679679  else:
    680     log_test_error('Changed dependencies not recognised')   
     680    logtesterror('Changed dependencies not recognised')   
    681681 
    682682  # Test recomputation when dependencies have changed
     
    685685               dependencies=DepFN)                       
    686686  if T1 == T3:
    687     log_test_OK('Recomputed value with changed dependencies')
     687    logtestOK('Recomputed value with changed dependencies')
    688688  else:
    689     log_test_error('Recomputed value with changed dependencies failed')
     689    logtesterror('Recomputed value with changed dependencies failed')
    690690
    691691  # Performance test (with statistics)
     
    706706  if T1 == T2:
    707707    if t1 > t2:
    708       log_test_OK('Performance test: relative time saved = %s pct' \
     708      logtestOK('Performance test: relative time saved = %s pct' \
    709709              %str(round((t1-t2)*100/t1,2)))
    710710  else:       
    711     log_test_error('Basic caching failed for new problem')
     711    logtesterror('Basic caching failed for new problem')
    712712           
    713713  # Test presence of statistics file
     
    720720        fid = open(CD+FN,'r')
    721721        fid.close()
    722     log_test_OK('Statistics files present')
     722    logtestOK('Statistics files present')
    723723  except:
    724     log_test_OK('Statistics files cannot be opened')         
     724    logtestOK('Statistics files cannot be opened')         
    725725     
    726726  print_header_box('Show sample output of the caching function:')
     
    742742                   'time.strptime() which is unavailable in Windows')
    743743     
    744   log_test_OK('Caching self test completed')   
     744  logtestOK('Caching self test completed')   
    745745     
    746746           
     
    768768                            # arguments.
    769769textwidth3 = 16             # Initial width of separation lines. Is modified.
    770 textwidth4 = 50             # Text width in log_test_OK()
     770textwidth4 = 50             # Text width in logtestOK()
    771771statsfile  = '.cache_stat'  # Basefilename for cached statistics.
    772772                            # It will reside in the chosen cache directory.
     
    24972497# -----------------------------------------------------------------------------
    24982498
    2499 def log_test_OK(msg):
     2499def logtestOK(msg):
    25002500  """Print OK msg if test is OK.
    25012501 
    25022502  USAGE
    2503     log_test_OK(message)
     2503    logtestOK(message)
    25042504  """
    25052505
     
    25122512# -----------------------------------------------------------------------------
    25132513
    2514 def log_test_error(msg):
     2514def logtesterror(msg):
    25152515  """Print error if test fails.
    25162516 
    25172517  USAGE
    2518     log_test_error(message)
     2518    logtesterror(message)
    25192519  """
    25202520 
  • trunk/anuga_core/source/anuga/caching/tests/test_caching.py

    r9551 r9566  
    218218             'use_cache': True,
    219219             'vertex_coordinates': None,
    220              'verbose': True,
     220             'verbose': False,
    221221             'max_read_lines': 500,
    222222             'acceptable_overshoot': 1.01,
     
    767767
    768768
    769     def Will_fail_test_objects(self):
     769    def Will_fail_objects(self):
    770770      """
    771771      This test shows how instances can't be effectively cached.
  • trunk/anuga_core/source/anuga/coordinate_transforms/tests/test_redfearn.py

    r9562 r9566  
    292292        for forced_zone in [53, 54]:
    293293       
    294             datafile = join(path, 'test', 'data', 'projection_test_points_z%d.csv' % forced_zone)
     294            datafile = join(path, 'tests', 'data', 'projection_test_points_z%d.csv' % forced_zone)
    295295            fid = open(datafile)
    296296
     
    328328
    329329        path = get_pathname_from_package('anuga.coordinate_transforms')
    330         datafile = join(path, 'test', 'data', 'projection_test_points.csv')
     330        datafile = join(path, 'tests', 'data', 'projection_test_points.csv')
    331331        fid = open(datafile)
    332332
  • trunk/anuga_core/source/anuga/culvert_flows/tests/test_culvert_class.py

    r9472 r9566  
    141141
    142142        path = get_pathname_from_package('anuga.culvert_flows')   
    143         path = os.path.join(path, 'test', 'data')
     143        path = os.path.join(path, 'tests', 'data')
    144144       
    145145        length = 40.
     
    260260
    261261        path = get_pathname_from_package('anuga.culvert_flows')
    262         path = os.path.join(path, 'test', 'data')   
     262        path = os.path.join(path, 'tests', 'data')   
    263263       
    264264        length = 40.
  • trunk/anuga_core/source/anuga/culvert_flows/tests/test_new_culvert_class.py

    r9472 r9566  
    140140
    141141        path = get_pathname_from_package('anuga.culvert_flows')
    142         path = os.path.join(path, 'test', 'data')   
     142        path = os.path.join(path, 'tests', 'data')   
    143143       
    144144        length = 40.
     
    257257
    258258        path = get_pathname_from_package('anuga.culvert_flows')
    259         path = os.path.join(path, 'test', 'data')   
     259        path = os.path.join(path, 'tests', 'data')   
    260260       
    261261       
  • trunk/anuga_core/source/anuga/file/tests/test_csv.py

    r9551 r9566  
    229229       
    230230        path = get_pathname_from_package('anuga.shallow_water')               
    231         testfile = os.path.join(path, 'test', 'data', 'polygon_values_example.csv')               
     231        testfile = os.path.join(path, 'tests', 'data', 'polygon_values_example.csv')               
    232232
    233233        polygons, values = load_csv_as_polygons(testfile,
     
    306306       
    307307        path = get_pathname_from_package('anuga.shallow_water')               
    308         testfile = os.path.join(path, 'test', 'data', 'polygon_values_example.csv')               
     308        testfile = os.path.join(path, 'tests', 'data', 'polygon_values_example.csv')               
    309309
    310310        polygons, values = load_csv_as_polygons(testfile,
     
    386386       
    387387        path = get_pathname_from_package('anuga.shallow_water')               
    388         testfile = os.path.join(path, 'test', 'data', 'polygon_values_example.csv')               
     388        testfile = os.path.join(path, 'tests', 'data', 'polygon_values_example.csv')               
    389389
    390390        polygons, values = load_csv_as_building_polygons(testfile,
  • trunk/anuga_core/source/anuga/file/tests/test_urs.py

    r9490 r9566  
    7474       
    7575   
    76     def dave_test_URS_points_needed(self):
     76    def in_development_URS_points_needed(self):
    7777        ll_lat = -21.51667
    7878        ll_long = 114.51667
     
    8989                                  verbose=self.verbose)
    9090       
    91     def X_test_URS_points_neededII(self):
    92         ll_lat = -21.5
    93         ll_long = 114.5
    94         grid_spacing = 1./60.
    95         lat_amount = 30
    96         long_amount = 30
    97 
    98         # change this so lats and longs are inputed, then converted
    99        
    100         #boundary_polygon = [[7660000,250000],[7660000,280000],
    101         #                     [7630000,280000],[7630000,250000]]
    102         calculate_boundary_points(boundary_polygon, ll_lat, ll_long,
    103                           grid_spacing,
    104                           lat_amount, long_amount,
    105                           verbose=self.verbose)
    10691       
    10792    def test_URS_points_northern_hemisphere(self):
     
    167152                assert False
    168153
    169     def covered_in_other_tests_test_URS_points_needed_poly1(self):
     154    def in_development_URS_points_needed_poly1(self):
    170155        # Values used for FESA 2007 results
    171156        # domain in southern hemisphere zone 51       
     
    194179
    195180
    196     def covered_in_other_tests_test_URS_points_needed_poly2(self):
     181    def in_development_URS_points_needed_poly2(self):
    197182        # Values used for 2004 validation work
    198183        # domain in northern hemisphere zone 47       
  • trunk/anuga_core/source/anuga/file_conversion/tests/test_urs2sts.py

    r9490 r9566  
    2929
    3030# Allow us to use helper methods from this test.
    31 from anuga.file.test.test_mux import Test_Mux
     31from anuga.file.tests.test_mux import Test_Mux
    3232
    3333class Test_Urs2Sts(Test_Mux):
     
    237237        path = get_pathname_from_package('anuga.shallow_water')       
    238238       
    239         testdir = os.path.join(path, 'test',  'urs_test_data')
     239        testdir = os.path.join(path, 'tests',  'urs_test_data')
    240240        ordering_filename=os.path.join(testdir, 'thinned_bound_order_test.txt')
    241241       
     
    406406        path = get_pathname_from_package('anuga.shallow_water')       
    407407               
    408         testdir = os.path.join(path, 'test', 'urs_test_data')       
     408        testdir = os.path.join(path, 'tests', 'urs_test_data')       
    409409        ordering_filename=os.path.join(testdir, 'thinned_bound_order_test.txt')
    410410
  • trunk/anuga_core/source/anuga/file_conversion/tests/test_urs2sww.py

    r9562 r9566  
    2626
    2727# use helper methods from other unit test
    28 from anuga.file.test.test_mux import Test_Mux
     28from anuga.file.tests.test_mux import Test_Mux
    2929
    3030
     
    274274                            ensure_numeric(times_actual))
    275275       
    276                #Check first value
     276        #Check first value
    277277        stage = fid.variables['stage'][:]
    278278        xmomentum = fid.variables['xmomentum'][:]
  • trunk/anuga_core/source/anuga/geometry/tests/test_polygon.py

    r9562 r9566  
    7373
    7474        # Form absolute filename and read
    75         filename = os.path.join( path, 'test', 'data', 'mainland_only.csv')
     75        filename = os.path.join( path, 'tests', 'data', 'mainland_only.csv')
    7676        p1 = read_polygon(filename)
    7777
     
    8888
    8989        # Form absolute filename and read
    90         filename = os.path.join( path, 'test', 'data', 'complex_polygon.csv')
     90        filename = os.path.join( path, 'tests', 'data', 'complex_polygon.csv')
    9191        # Should cause an Exception
    9292        try:
     
    106106
    107107        # Form absolute filename and read
    108         filename = os.path.join( path, 'test', 'data',  'non_complex_polygon.csv')
     108        filename = os.path.join( path, 'tests', 'data',  'non_complex_polygon.csv')
    109109        # Should cause an Exception
    110110        try:
     
    121121
    122122        # Form absolute filename and read
    123         filename = os.path.join( path, 'test', 'data',  'complex_polygon.csv')
     123        filename = os.path.join( path, 'tests', 'data',  'complex_polygon.csv')
    124124        # Should not cause an Exception
    125125        p1 = read_polygon(filename, closed=False)
  • trunk/anuga_core/source/anuga/geospatial_data/tests/test_geospatial_data.py

    r9562 r9566  
    918918        os.remove(pts_file)
    919919
    920     def verbose_test_load_pts_blocking(self):
     920    def test_load_pts_blocking_2(self):
    921921        fileName = tempfile.mktemp('.txt')
    922922        file = open(fileName, 'w')
     
    974974        convert = Geospatial_data(fileName)
    975975        convert.export_points_file(pts_file)
    976         results = Geospatial_data(pts_file, max_read_lines=2, verbose=True)
     976        results = Geospatial_data(pts_file, max_read_lines=2, verbose=False)
    977977
    978978        # Blocking
  • trunk/anuga_core/source/anuga/lib/tests/test_maxasc.py

    r9562 r9566  
    9292
    9393    def test_unequal_lines(self):
    94         test_path = aust.get_pathname_from_package('anuga.lib.test')
     94        test_path = aust.get_pathname_from_package('anuga.lib.tests')
    9595        in_file = os.path.join(test_path, 'test1.asc')
    9696        expected_file = os.path.join(test_path, 'test1_bad_num_lines.asc')
     
    100100
    101101    def test_headers_differ(self):
    102         test_path = aust.get_pathname_from_package('anuga.lib.test')
     102        test_path = aust.get_pathname_from_package('anuga.lib.tests')
    103103        in_file = os.path.join(test_path, 'test1.asc')
    104104        expected_file = os.path.join(test_path, 'test1_bad_num_lines.asc')
     
    108108
    109109    def test_wrong_num_columns(self):
    110         test_path = aust.get_pathname_from_package('anuga.lib.test')
     110        test_path = aust.get_pathname_from_package('anuga.lib.tests')
    111111        in_file = os.path.join(test_path, 'test1.asc')
    112112        expected_file = os.path.join(test_path, 'test1_wrong_num_columns.asc')
     
    116116
    117117    def test_same_input_equals_output1(self):
    118         test_path = aust.get_pathname_from_package('anuga.lib.test')
     118        test_path = aust.get_pathname_from_package('anuga.lib.tests')
    119119        in_file = os.path.join(test_path, 'test1.asc')
    120120        MaxAsc('test1.out.asc', [in_file])
     
    123123
    124124    def test_same_input_equals_outputN(self):
    125         test_path = aust.get_pathname_from_package('anuga.lib.test')
     125        test_path = aust.get_pathname_from_package('anuga.lib.tests')
    126126        in_file = os.path.join(test_path, 'test1.asc')
    127127        MaxAsc('test1.out.asc', [in_file] * 30)
     
    129129
    130130    def test_different_input2(self):
    131         test_path = aust.get_pathname_from_package('anuga.lib.test')
     131        test_path = aust.get_pathname_from_package('anuga.lib.tests')
    132132        in_file = os.path.join(test_path, 'test1.asc')
    133133        in_file2 = os.path.join(test_path, 'test2.asc')
     
    137137
    138138    def test_different_input3(self):
    139         test_path = aust.get_pathname_from_package('anuga.lib.test')
     139        test_path = aust.get_pathname_from_package('anuga.lib.tests')
    140140        in_file = os.path.join(test_path, 'test1.asc')
    141141        in_file2 = os.path.join(test_path, 'test2.asc')
  • trunk/anuga_core/source/anuga/parallel/tests/test_all.py

    r9514 r9566  
    7676# @return A tuple (<files>, <dirs>).
    7777# @note Don't include any files in and below forbidden directories.
    78 def get_test_files(path):
     78def get_unittestfiles(path):
    7979    walk = os.walk(path)
    8080
     
    116116
    117117    # get all test_*.py and enclosing directories
    118     test_files, path_files = get_test_files(path)
     118    test_files, path_files = get_unittestfiles(path)
    119119    path_files.sort()
    120120
  • trunk/anuga_core/source/anuga/parallel/tests/test_failure.py

    r9501 r9566  
    8888samples = 50
    8989
    90 def run_test(parallel = False, control_data = None, test_points = None, verbose = False):
     90def run_simulation(parallel = False, control_data = None, test_points = None, verbose = False):
    9191    success = True
    9292
     
    316316
    317317    if myid == 0:
    318         control_data = run_test(parallel=False, test_points = test_points, verbose = True)
     318        control_data = run_simulation(parallel=False, test_points = test_points, verbose = True)
    319319       
    320320        for proc in range(1,numprocs):
     
    324324
    325325    pypar.barrier()
    326     run_test(parallel=True, control_data = control_data, test_points = test_points, verbose = True)
     326    run_simulation(parallel=True, control_data = control_data, test_points = test_points, verbose = True)
    327327
    328328
  • trunk/anuga_core/source/anuga/parallel/tests/test_parallel_boyd_box_op_apron.py

    r9501 r9566  
    9696samples = 50
    9797
    98 def run_test(parallel = False, control_data = None, test_points = None, verbose = False):
     98def run_simulation(parallel = False, control_data = None, test_points = None, verbose = False):
    9999    success = True
    100100
     
    353353
    354354        if myid == 0:
    355             control_data = run_test(parallel=False, test_points = test_points, verbose = verbose)
     355            control_data = run_simulation(parallel=False, test_points = test_points, verbose = verbose)
    356356
    357357            for proc in range(1,numprocs):
     
    362362
    363363        pypar.barrier()
    364         run_test(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose)
     364        run_simulation(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose)
    365365
    366366
  • trunk/anuga_core/source/anuga/parallel/tests/test_parallel_boyd_box_operator.py

    r9514 r9566  
    103103samples = 50
    104104
    105 def run_test(parallel = False, control_data = None, test_points = None, verbose = False):
     105def run_simulation(parallel = False, control_data = None, test_points = None, verbose = False):
    106106    success = True
    107107
     
    318318
    319319        if myid == 0:
    320             control_data = run_test(parallel=False, test_points = test_points, verbose = verbose)
     320            control_data = run_simulation(parallel=False, test_points = test_points, verbose = verbose)
    321321
    322322            for proc in range(1,numprocs):
     
    327327
    328328        pypar.barrier()
    329         run_test(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose)
     329        run_simulation(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose)
    330330
    331331
  • trunk/anuga_core/source/anuga/parallel/tests/test_parallel_boyd_pipe_operator.py

    r9501 r9566  
    9797samples = 50
    9898
    99 def run_test(parallel = False, control_data = None, test_points = None, verbose = False):
     99def run_simulation(parallel = False, control_data = None, test_points = None, verbose = False):
    100100    success = True
    101101
     
    344344
    345345        if myid == 0:
    346             control_data = run_test(parallel=False, test_points = test_points, verbose = verbose)
     346            control_data = run_simulation(parallel=False, test_points = test_points, verbose = verbose)
    347347
    348348            for proc in range(1,numprocs):
     
    353353
    354354        pypar.barrier()
    355         run_test(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose)
    356 
    357 
    358    
    359 
     355        run_simulation(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose)
     356
     357
     358   
     359
  • trunk/anuga_core/source/anuga/parallel/tests/test_parallel_distribute_domain.py

    r9501 r9566  
    8383# Setup test
    8484#--------------------------------------------------------------------------
    85 def evolution_test(parallel=False):
     85def run_simulation(parallel=False):
    8686
    8787
     
    201201        if myid == 0:
    202202            if verbose: print 'SEQUENTIAL START'
    203             l1norm_seq, l2norm_seq, linfnorm_seq = evolution_test(parallel=False)
     203            l1norm_seq, l2norm_seq, linfnorm_seq = run_simulation(parallel=False)
    204204
    205205        pypar.barrier()
     
    207207            if verbose: print 'PARALLEL START'
    208208       
    209         l1norm_par, l2norm_par, linfnorm_par = evolution_test(parallel=True)
     209        l1norm_par, l2norm_par, linfnorm_par = run_simulation(parallel=True)
    210210       
    211211        if myid == 0:
  • trunk/anuga_core/source/anuga/parallel/tests/test_parallel_file_boundary.py

    r9551 r9566  
    5858from anuga.parallel import distribute, myid, numprocs, send, receive, barrier, finalize
    5959
    60 from anuga.file.test.test_mux import Test_Mux
     60from anuga.file.tests.test_mux import Test_Mux
    6161
    6262verbose = False
     
    7070    """
    7171
    72     def sequential_test_time_varying_file_boundary_sts(self):
     72    def sequential_time_varying_file_boundary_sts(self):
    7373        """sequential_ltest_time_varying_file_boundary_sts_sequential(self):
    7474        Read correct points from ordering file and apply sts to boundary. The boundary is time varying. FIXME add to test_urs2sts.
     
    229229        if myid==0: os.remove(meshname)
    230230
    231     def parallel_test_time_varying_file_boundary_sts(self):
     231    def parallel_time_varying_file_boundary_sts(self):
    232232        """ parallel_test_time_varying_file_boundary_sts_sequential(self):
    233233            Read correct points from ordering file and apply sts to boundary.
  • trunk/anuga_core/source/anuga/parallel/tests/test_parallel_frac_op.py

    r9501 r9566  
    9797samples = 50
    9898
    99 def run_test(parallel = False, control_data = None, test_points = None, verbose = False):
     99def run_simulation(parallel = False, control_data = None, test_points = None, verbose = False):
    100100    success = True
    101101
     
    320320
    321321        if myid == 0:
    322             control_data, success  = run_test(parallel=False, test_points = test_points, verbose = verbose)
     322            control_data, success  = run_simulation(parallel=False, test_points = test_points, verbose = verbose)
    323323
    324324            for proc in range(1,numprocs):
     
    329329
    330330        pypar.barrier()
    331         _, success = run_test(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose)
     331        _, success = run_simulation(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose)
    332332
    333333        sys.stdout.flush()
  • trunk/anuga_core/source/anuga/parallel/tests/test_parallel_inlet_operator.py

    r9501 r9566  
    102102samples = 50
    103103
    104 def run_test(parallel = False, control_data = None, test_points = None, verbose = False):
     104def run_simulation(parallel = False, control_data = None, test_points = None, verbose = False):
    105105    success = True
    106106
     
    306306
    307307        if myid == 0:
    308             control_data = run_test(parallel=False, test_points = test_points, verbose = verbose)
     308            control_data = run_simulation(parallel=False, test_points = test_points, verbose = verbose)
    309309
    310310            for proc in range(1,numprocs):
     
    315315
    316316        pypar.barrier()
    317         run_test(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose)
     317        run_simulation(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose)
    318318
    319319
  • trunk/anuga_core/source/anuga/parallel/tests/test_parallel_riverwall.py

    r9433 r9566  
    6262# Setup Test
    6363##########################################################################
    64 def evolution_test(parallel=False, verbose=False):
     64def run_simulation(parallel=False, verbose=False):
    6565
    6666    #--------------------------------------------------------------------------
     
    248248        #------------------------------------------
    249249        if myid ==0 and verbose: print 'PARALLEL START'
    250         evolution_test(parallel=True, verbose=verbose)
     250        run_simulation(parallel=True, verbose=verbose)
    251251        finalize()
    252252
  • trunk/anuga_core/source/anuga/parallel/tests/test_parallel_shallow_domain.py

    r9501 r9566  
    6060mod_path = get_pathname_from_package('anuga.parallel')
    6161
    62 mesh_filename = os.path.join('..','data','merimbula_10785_1.tsh')
     62mesh_filename = os.path.join(mod_path,'data','merimbula_10785_1.tsh')
    6363#mesh_filename = os.path.join('..','data','test-100.tsh')
    6464yieldstep = 1
     
    8686# Setup test
    8787#--------------------------------------------------------------------------
    88 def evolution_test(parallel=False):
     88def run_simulation(parallel=False):
    8989
    9090
     
    150150            if verbose: print 'PARALLEL START'
    151151
    152         evolution_test(parallel=True)
     152        run_simulation(parallel=True)
    153153       
    154154        if myid == 0:     
  • trunk/anuga_core/source/anuga/parallel/tests/test_parallel_sw_flow.py

    r9501 r9566  
    4848# Setup Test
    4949##########################################################################
    50 def evolution_test(parallel=False, G = None, seq_interpolation_points=None, verbose=False):
     50def run_simulation(parallel=False, G = None, seq_interpolation_points=None, verbose=False):
    5151
    5252    #--------------------------------------------------------------------------
     
    199199        if myid == 0 and verbose: print 'SEQUENTIAL START'
    200200
    201         G , interpolation_points = evolution_test(parallel=False,verbose=verbose)
     201        G , interpolation_points = run_simulation(parallel=False,verbose=verbose)
    202202        G = num.array(G,num.float)
    203203
     
    210210        if myid ==0 and verbose: print 'PARALLEL START'
    211211
    212         evolution_test(parallel=True, G=G, seq_interpolation_points = interpolation_points, verbose= verbose)
     212        run_simulation(parallel=True, G=G, seq_interpolation_points = interpolation_points, verbose= verbose)
    213213       
    214214        finalize()
  • trunk/anuga_core/source/anuga/parallel/tests/test_sequential_dist_sw_flow.py

    r9501 r9566  
    6060# Setup Test
    6161##########################################################################
    62 def evolution_test(parallel=False, verbose=False):
     62def run_simulation(parallel=False, verbose=False):
    6363
    6464    #--------------------------------------------------------------------------
     
    316316        if myid ==0 and verbose: print 'PARALLEL START'
    317317
    318         evolution_test(parallel=True, verbose=verbose)
     318        run_simulation(parallel=True, verbose=verbose)
    319319       
    320320        finalize()
  • trunk/anuga_core/source/anuga/shallow_water/tests/test_data_manager.py

    r9550 r9566  
    6262
    6363# use helper methods from other unit test
    64 from anuga.file.test.test_mux import Test_Mux
     64from anuga.file.tests.test_mux import Test_Mux
    6565
    6666
  • trunk/anuga_core/source/anuga/shallow_water/tests/test_shallow_water_domain.py

    r9562 r9566  
    72407240       
    72417241        # Large test set revealed one problem
    7242         points_file = os.path.join(path, 'test', 'data', 'test_points_large.csv')
     7242        points_file = os.path.join(path, 'tests', 'data', 'test_points_large.csv')
    72437243
    72447244        domain.set_quantity('elevation', filename=points_file,
     
    72547254
    72557255        # Small test set revealed another problem
    7256         points_file = os.path.join(path, 'test', 'data', 'test_points_small.csv')
     7256        points_file = os.path.join(path, 'tests', 'data', 'test_points_small.csv')
    72577257        try:   
    72587258            domain.set_quantity('elevation', filename=points_file,
  • trunk/anuga_core/source/anuga/structures/tests/test_inlet_operator.py

    r9459 r9566  
    218218       
    219219        path = get_pathname_from_package('anuga.structures')
    220         filename1 = os.path.join(path, 'test', 'data', 'inlet_operator_test1.tms')
    221         filename2 = os.path.join(path, 'test', 'data', 'inlet_operator_test2.tms')
     220        filename1 = os.path.join(path, 'tests', 'data', 'inlet_operator_test1.tms')
     221        filename2 = os.path.join(path, 'tests', 'data', 'inlet_operator_test2.tms')
    222222
    223223        line1 = [[95.0, 10.0], [105.0, 10.0]]
     
    278278
    279279        path = get_pathname_from_package('anuga.structures')
    280         filename1 = os.path.join(path, 'test', 'data', 'inlet_operator_test1.tms')
    281         filename2 = os.path.join(path, 'test', 'data', 'inlet_operator_test2.tms')
     280        filename1 = os.path.join(path, 'tests', 'data', 'inlet_operator_test1.tms')
     281        filename2 = os.path.join(path, 'tests', 'data', 'inlet_operator_test2.tms')
    282282
    283283        line1 = [[95.0, 10.0], [105.0, 10.0]]
  • trunk/anuga_core/source/anuga/tsunami_source/tests/test_tsunami_okada.py

    r9457 r9566  
    3535        if T==0:
    3636            # Fortran output file           
    37             filename = path+sep+'test'+sep+'data'+sep+'fullokada_SP.txt'
     37            filename = path+sep+'tests'+sep+'data'+sep+'fullokada_SP.txt'
    3838           
    3939            # Initial condition of earthquake for multiple source
     
    5151        elif T==1:
    5252            # Fortran output file       
    53             filename = path+sep+'test'+sep+'data'+sep+'fullokada_SS.txt'
     53            filename = path+sep+'tests'+sep+'data'+sep+'fullokada_SS.txt'
    5454           
    5555            # Initial condition of earthquake for multiple source
     
    6969
    7070            # Fortran output file
    71             filename = path+sep+'test'+sep+'data'+sep+'fullokada_MS.txt'
     71            filename = path+sep+'tests'+sep+'data'+sep+'fullokada_MS.txt'
    7272           
    7373            # Initial condition of earthquake for multiple source
     
    173173        if T==0:
    174174            # Fortran output file
    175             filename = path+sep+'test'+sep+'data'+sep+'fullokada_SP.txt'
     175            filename = path+sep+'tests'+sep+'data'+sep+'fullokada_SP.txt'
    176176           
    177177            # Initial condition of earthquake for multiple source
     
    189189        elif T==1:
    190190            # Fortran output file
    191             filename = path+sep+'test'+sep+'data'+sep+'fullokada_SS.txt'
     191            filename = path+sep+'tests'+sep+'data'+sep+'fullokada_SS.txt'
    192192           
    193193            # Initial condition of earthquake for multiple source
     
    207207
    208208            # Fortran output file
    209             filename = path+sep+'test'+sep+'data'+sep+'fullokada_MS.txt'
     209            filename = path+sep+'tests'+sep+'data'+sep+'fullokada_MS.txt'
    210210           
    211211            # Initial condition of earthquake for multiple source
  • trunk/anuga_core/source/anuga/utilities/numerical_tools.py

    r9562 r9566  
    389389#Initialise module
    390390
    391 #from .util_ext import gradient, gradient2
     391from .util_ext import gradient, gradient2
    392392
    393393
  • trunk/anuga_core/source/anuga/utilities/tests/test_system_tools.py

    r9562 r9566  
    127127        path = get_pathname_from_package('anuga.utilities')       
    128128               
    129         filename = os.path.join(path, 'test', 'data', 'crc_test_file.png')
     129        filename = os.path.join(path, 'tests', 'data', 'crc_test_file.png')
    130130
    131131
     
    209209        new_str_list = char_to_string(x)
    210210
    211         self.assertTrueEqual(new_str_list, str_list)
     211        self.failUnlessEqual(new_str_list, str_list)
    212212
    213213    # special test - input list is ['']
     
    219219        new_str_list = char_to_string(x)
    220220
    221         self.assertTrueEqual(new_str_list, str_list)
     221        self.failUnlessEqual(new_str_list, str_list)
    222222
    223223
     
    282282        new_str_list = self.helper_read_msh_file(FILENAME)
    283283
    284         self.assertTrueEqual(new_str_list, str_list)
     284        self.failUnlessEqual(new_str_list, str_list)
    285285        os.remove(FILENAME)
    286286
     
    295295        new_str_list = self.helper_read_msh_file(FILENAME)
    296296
    297         self.assertTrueEqual(new_str_list, str_list)
     297        self.failUnlessEqual(new_str_list, str_list)
    298298        os.remove(FILENAME)
    299299
     
    308308            msg = ("Source: '%s'\nResult: %s\nExpected: %s"
    309309                   % (source, str(result), str(expected)))
    310             self.assertTrueEqual(result, expected, msg)
     310            self.failUnlessEqual(result, expected, msg)
    311311               
    312312        source = 'fred'
  • trunk/anuga_core/source/setup.cfg

    r9555 r9566  
    11
    22[pytest]
    3 addopts = --ignore=anuga/test_all.py --ignore=setup.py --ignore=anuga/build --ignore=anuga/parallel --cov-report term --cov .
     3addopts = --ignore=anuga/test_all.py
     4        --ignore=build
     5        --ignore=setup.py
     6        --ignore=anuga/build
     7        --ignore=anuga/parallel
     8        --cov-report term --cov .
Note: See TracChangeset for help on using the changeset viewer.