Changeset 1888


Ignore:
Timestamp:
Oct 10, 2005, 4:32:26 PM (19 years ago)
Author:
duncan
Message:

added test for checking exit status when using least_squares.py in the command line.

Location:
inundation/pyvolution
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/least_squares.py

    r1887 r1888  
    12651265    """
    12661266    import os, sys
    1267     usage = "usage: %s mesh_input.tsh point.xya mesh_output.tsh [expand|no_expand][vervose|non_verbose] [alpha]"\
     1267    usage = "usage: %s mesh_input.tsh point.xya mesh_output.tsh [expand|no_expand][vervose|non_verbose] [alpha] [display_errors|no_display_errors]"\
    12681268            %os.path.basename(sys.argv[0])
    12691269
     
    12941294            alpha = DEFAULT_ALPHA
    12951295
     1296        # This is used more for testing
     1297        if len(sys.argv) > 7:
     1298            if sys.argv[7][0] == "n" or sys.argv[5][0] == "N":
     1299                display_errors = False
     1300            else:
     1301                display_errors = True
     1302           
    12961303        t0 = time.time()
    12971304        try:
     
    13011308                         alpha,
    13021309                         verbose= verbose,
    1303                          expand_search = expand_search)
     1310                         expand_search = expand_search,
     1311                         display_errors = display_errors)
    13041312        except IOError,e:
    1305             import sys; sys.exit()
     1313            import sys; sys.exit(1)
    13061314
    13071315        print 'That took %.2f seconds' %(time.time()-t0)
  • inundation/pyvolution/test_least_squares.py

    r1882 r1888  
    15411541        os.remove(mesh_file)
    15421542        os.remove(point_file)
     1543 
     1544    def test_fit_to_mesh_file_errorsIV(self):
     1545        import os
     1546        status = os.system('python least_squares.py q q q e n 0.9 n')
     1547        self.failUnless(status  == 1,
     1548                        'command prompt least_squares.py failed.  Incorect exit status.')
    15431549       
    15441550    def test_fit_to_msh_netcdf_fileII(self):
Note: See TracChangeset for help on using the changeset viewer.