Changeset 4528


Ignore:
Timestamp:
Jun 4, 2007, 1:32:11 PM (17 years ago)
Author:
ole
Message:

Fixed polygon test so that it can run both from within its own directory and from test_all.py one level above it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/utilities/test_polygon.py

    r4527 r4528  
    5757        assert allclose(z, [2,1,0,2])
    5858
    59     def NO_test_polygon_function_csvfile(self):
     59    def test_polygon_function_csvfile(self):
    6060        from os import sep, getenv
    61        
    62         p1 = read_polygon('mainland_only.csv')
     61
     62        try:
     63            # When unit test is run from current dir
     64            p1 = read_polygon('mainland_only.csv')
     65        except:
     66            # When unit test is run from ANUGA root dir
     67            from os.path import join
     68
     69            path = join('utilities', 'mainland_only.csv')
     70            p1 = read_polygon(path)
     71       
     72           
    6373       
    6474        f = Polygon_function( [(p1, 10.0)] )
Note: See TracChangeset for help on using the changeset viewer.