Ignore:
Timestamp:
Jun 4, 2010, 10:03:48 PM (14 years ago)
Author:
hudson
Message:

Cleaned up unit tests to use API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/file_conversion/test_urs2sts.py

    r7770 r7778  
    1313from anuga.file.csv_file import load_csv_as_dict, load_csv_as_array
    1414
     15from anuga.shallow_water.shallow_water_domain import Domain
     16
    1517# boundary functions
    1618from anuga.shallow_water.boundaries import Reflective_boundary, \
     
    2022     import Transmissive_boundary, Dirichlet_boundary, \
    2123            Time_boundary, File_boundary, AWI_boundary
     24
     25from anuga.pmesh.mesh_interface import create_mesh_from_regions
    2226
    2327from urs2sts import urs2sts
     
    13161320        """
    13171321       
    1318         # FIXME (Ole): These tests should really move to
    1319         # test_generic_boundaries.py
    1320        
    1321         from anuga.shallow_water import Domain
    1322         from anuga.shallow_water import Reflective_boundary
    1323         from anuga.shallow_water import Dirichlet_boundary
    1324         from anuga.shallow_water import File_boundary
    1325         from anuga.pmesh.mesh_interface import create_mesh_from_regions
    1326 
    13271322        bounding_polygon=[[6.0,97.0],[6.01,97.0],[6.02,97.0],[6.02,97.02],[6.00,97.02]]
    13281323        tide = 0.37
     
    14581453        import warnings
    14591454        warnings.simplefilter('ignore')
    1460        
    1461         from anuga.shallow_water import Domain
    1462         from anuga.shallow_water import Reflective_boundary
    1463         from anuga.shallow_water import Dirichlet_boundary
    1464         from anuga.shallow_water import File_boundary
    1465         from anuga.pmesh.mesh_interface import create_mesh_from_regions
    14661455
    14671456        bounding_polygon=[[6.0,97.0],[6.01,97.0],[6.02,97.0],
     
    16051594        import warnings
    16061595        warnings.simplefilter('ignore')
    1607        
    1608         from anuga.shallow_water import Domain
    1609         from anuga.shallow_water import Reflective_boundary
    1610         from anuga.shallow_water import Dirichlet_boundary
    1611         from anuga.shallow_water import File_boundary
    1612         from anuga.pmesh.mesh_interface import create_mesh_from_regions
    16131596
    16141597        bounding_polygon=[[6.0,97.0],[6.01,97.0],[6.02,97.0],
     
    17231706         the correct order).
    17241707         """
    1725          
    1726         from anuga.shallow_water import Domain
    1727         from anuga.shallow_water import Reflective_boundary
    1728         from anuga.shallow_water import Dirichlet_boundary
    1729         from anuga.shallow_water import File_boundary
    1730         from anuga.pmesh.mesh_interface import create_mesh_from_regions
    17311708
    17321709        bounding_polygon=[[6.01,97.0],[6.02,97.0],[6.02,97.02],[6.00,97.02],[6.0,97.0]]
     
    18311808        Read correct points from ordering file and apply sts to boundary
    18321809        """
    1833         from anuga.shallow_water import Domain
    1834         from anuga.shallow_water import Reflective_boundary
    1835         from anuga.shallow_water import Dirichlet_boundary
    1836         from anuga.shallow_water import File_boundary
    1837         from anuga.pmesh.mesh_interface import create_mesh_from_regions
    18381810
    18391811        lat_long_points=[[6.01,97.0],[6.02,97.0],[6.05,96.9],[6.0,97.0]]
     
    18591831                                           ua=ua,
    18601832                                           va=va)
     1833        # base name will not exist, but 3 other files are created
    18611834
    18621835        # Write order file
     
    18861859        self.delete_mux(files)
    18871860
    1888         assert(os.access(base_name, os.R_OK))
     1861        assert(os.access(sts_file+'.sts', os.F_OK))
    18891862
    18901863        boundary_polygon = create_sts_boundary(base_name)
     
    19791952        #assert allclose(domain_drchlt.quantities['stage'].vertex_values[6], 2)       
    19801953        #assert allclose(domain_fbound.quantities['stage'].vertex_values[6], 2)
    1981        
    1982        
    19831954
    19841955        try:
    19851956            os.remove(sts_file+'.sts')
    1986         except:
     1957        except IOError:
    19871958            # Windoze can't remove this file for some reason
    19881959            pass
Note: See TracChangeset for help on using the changeset viewer.