Changeset 9441


Ignore:
Timestamp:
Jan 20, 2015, 5:26:46 PM (10 years ago)
Author:
steve
Message:

Cleanup inlet test file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/structures/test/test_inlet_operator.py

    r9440 r9441  
    1212from anuga.shallow_water.shallow_water_domain import Domain
    1313from anuga.abstract_2d_finite_volumes.util import file_function
     14from anuga.utilities.system_tools import get_pathname_from_package
    1415
    1516from anuga.structures.inlet_operator import Inlet_operator
     
    2425
    2526    def tearDown(self):
    26         pass
     27        try:
     28            os.remove('Test_Outlet_Inlet.sww')
     29        except:
     30            pass
     31       
    2732   
    2833   
     
    210215        baseDir = os.getcwd()
    211216
    212         try:
    213             os.chdir('structures')
    214         except:
    215             pass
     217#         try:
     218#             os.chdir('structures')
     219#         except:
     220#             pass
     221       
     222        path = get_pathname_from_package('anuga.structures')
     223        filename1 = os.path.join(path, 'data', 'inlet_operator_test1.tms')
     224        filename2 = os.path.join(path, 'data', 'inlet_operator_test2.tms')
    216225
    217226        line1 = [[95.0, 10.0], [105.0, 10.0]]
    218         Q1 = file_function(filename='inlet_operator_test1.tms', quantities=['hydrograph'])
     227        Q1 = file_function(filename=filename1, quantities=['hydrograph'])
    219228       
    220229        line2 = [[10.0, 90.0], [20.0, 90.0]]
    221         Q2 = file_function(filename='inlet_operator_test2.tms', quantities=['hydrograph'])
     230        Q2 = file_function(filename=filename2, quantities=['hydrograph'])
    222231
    223232        os.chdir(baseDir)
     
    272281        baseDir = os.getcwd()
    273282
    274         try:
    275             os.chdir('structures')
    276         except:
    277             pass
     283        path = get_pathname_from_package('anuga.structures')
     284        filename1 = os.path.join(path, 'data', 'inlet_operator_test1.tms')
     285        filename2 = os.path.join(path, 'data', 'inlet_operator_test2.tms')
    278286
    279287        line1 = [[95.0, 10.0], [105.0, 10.0]]
    280         Q1 = file_function(filename='inlet_operator_test1.tms', quantities=['hydrograph'])
     288        Q1 = file_function(filename=filename1, quantities=['hydrograph'])
    281289
    282290        line2 = [[10.0, 90.0], [20.0, 90.0]]
    283         Q2 = file_function(filename='inlet_operator_test2.tms', quantities=['hydrograph'])
     291        Q2 = file_function(filename=filename2, quantities=['hydrograph'])
    284292
    285293        os.chdir(baseDir)
Note: See TracChangeset for help on using the changeset viewer.