Changeset 4526


Ignore:
Timestamp:
Jun 1, 2007, 4:39:17 PM (18 years ago)
Author:
duncan
Message:

ticket#169

Location:
anuga_core/source/anuga
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/damage_modelling/inundation_damage.py

    r4504 r4526  
    140140    dir_ls = os.listdir(dir)
    141141    interate_over = [x for x in dir_ls if base in x and x[-4:] == '.sww']
     142    if len(interate_over) == 0:
     143        msg = 'No files of the base name %s.'\
     144              %(sww_base_name)
     145        raise IOError, msg
    142146    #print "interate_over", interate_over
    143147    from os import sep
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r4524 r4526  
    16491649    #print "base",base
    16501650   
    1651     if dir == "": dir = "." # Unix compatibility
     1651    if dir == "":
     1652        dir = "." # Unix compatibility
    16521653    dir_ls = os.listdir(dir)
    16531654    interate_over = [x[:-4] for x in dir_ls if base in x and x[-4:] == '.sww']
    1654     #print "interate_over", interate_over
     1655
     1656    if len(interate_over) == 0:
     1657        msg = 'No files of the base name %s.'\
     1658              %(basename_in)
     1659        raise IOError, msg
    16551660   
    16561661    files_out = []
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r4520 r4526  
    16331633        os.remove(ascfile)
    16341634        os.remove(swwfile)
     1635
     1636    def test_export_grid_bad(self):
     1637        """Test that sww information can be converted correctly to asc/prj
     1638        format readable by e.g. ArcView
     1639        """
     1640
     1641        try:
     1642            export_grid('a_small_round-egg',
     1643                        quantities = ['elevation', 'depth'],
     1644                        cellsize = 99,
     1645                        verbose = self.verbose,
     1646                        format = 'asc')
     1647        except IOError:
     1648            pass
     1649        else:
     1650            self.failUnless(0 ==1,  'Bad input did not throw exception error!')
    16351651
    16361652    def test_export_grid_parallel(self):
Note: See TracChangeset for help on using the changeset viewer.