Changeset 3745


Ignore:
Timestamp:
Mar 1, 2011 6:38:27 PM (9 years ago)
Author:
wehart
Message:

Change tests to eliminate the use of deprecated 'fail*' syntax.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/coopr/pysp/tests/unit/test_ph.py

    r3698 r3745  
    8080        pyutilib.misc.reset_redirect()
    8181        self.cleanup()       
    82         self.failUnlessFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_cplex.out",this_test_file_directory+"farmer_quadratic_cplex.baseline", filter=filter_time_and_data_dirs)
     82        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_cplex.out",this_test_file_directory+"farmer_quadratic_cplex.baseline", filter=filter_time_and_data_dirs)
    8383
    8484    @unittest.skipIf(not gurobi_available, "The 'gurobi' executable is not available")
     
    9393        pyutilib.misc.reset_redirect()
    9494        self.cleanup()       
    95         self.failUnlessFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_gurobi.out",this_test_file_directory+"farmer_quadratic_gurobi.baseline", filter=filter_time_and_data_dirs)
     95        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_gurobi.out",this_test_file_directory+"farmer_quadratic_gurobi.baseline", filter=filter_time_and_data_dirs)
    9696
    9797    @unittest.skipIf(not cplex_available, "The 'cplex' executable is not available")
     
    106106        pyutilib.misc.reset_redirect()
    107107        self.cleanup()       
    108         self.failUnlessFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_verbose_cplex.out",this_test_file_directory+"farmer_quadratic_verbose_cplex.baseline", filter=filter_time_and_data_dirs)               
     108        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_verbose_cplex.out",this_test_file_directory+"farmer_quadratic_verbose_cplex.baseline", filter=filter_time_and_data_dirs)               
    109109
    110110    @unittest.skipIf(not gurobi_available, "The 'gurobi' executable is not available")
     
    119119        pyutilib.misc.reset_redirect()
    120120        self.cleanup()       
    121         self.failUnlessFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_verbose_gurobi.out",this_test_file_directory+"farmer_quadratic_verbose_gurobi.baseline", filter=filter_time_and_data_dirs)       
     121        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_verbose_gurobi.out",this_test_file_directory+"farmer_quadratic_verbose_gurobi.baseline", filter=filter_time_and_data_dirs)       
    122122
    123123    @unittest.skipIf(not cplex_available, "The 'cplex' executable is not available")
     
    132132        pyutilib.misc.reset_redirect()
    133133        self.cleanup()       
    134         self.failUnlessFileEqualsBaseline(this_test_file_directory+"farmer_with_rent_quadratic_cplex.out",this_test_file_directory+"farmer_with_rent_quadratic_cplex.baseline", filter=filter_time_and_data_dirs)       
     134        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_with_rent_quadratic_cplex.out",this_test_file_directory+"farmer_with_rent_quadratic_cplex.baseline", filter=filter_time_and_data_dirs)       
    135135
    136136    @unittest.skipIf(not gurobi_available, "The 'gurobi' executable is not available")
     
    145145        pyutilib.misc.reset_redirect()
    146146        self.cleanup()       
    147         self.failUnlessFileEqualsBaseline(this_test_file_directory+"farmer_with_rent_quadratic_gurobi.out",this_test_file_directory+"farmer_with_rent_quadratic_gurobi.baseline", filter=filter_time_and_data_dirs)       
     147        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_with_rent_quadratic_gurobi.out",this_test_file_directory+"farmer_with_rent_quadratic_gurobi.baseline", filter=filter_time_and_data_dirs)       
    148148       
    149149    @unittest.skipIf(not cplex_available, "The 'cplex' executable is not available")
     
    160160        pyutilib.misc.reset_redirect()
    161161        self.cleanup()               
    162         self.failUnlessFileEqualsBaseline(this_test_file_directory+"farmer_linearized_cplex.out",this_test_file_directory+"farmer_linearized_cplex.baseline", filter=filter_time_and_data_dirs)
     162        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_linearized_cplex.out",this_test_file_directory+"farmer_linearized_cplex.baseline", filter=filter_time_and_data_dirs)
    163163
    164164    @unittest.skipIf(not gurobi_available, "The 'gurobi' executable is not available")
     
    175175        pyutilib.misc.reset_redirect()
    176176        self.cleanup()               
    177         self.failUnlessFileEqualsBaseline(this_test_file_directory+"farmer_linearized_gurobi.out",this_test_file_directory+"farmer_linearized_gurobi.baseline", filter=filter_time_and_data_dirs)
     177        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_linearized_gurobi.out",this_test_file_directory+"farmer_linearized_gurobi.baseline", filter=filter_time_and_data_dirs)
    178178
    179179    @unittest.skipIf(not cplex_available, "The 'cplex' executable is not available")
     
    190190        pyutilib.misc.reset_redirect()
    191191        self.cleanup()               
    192         self.failUnlessFileEqualsBaseline(this_test_file_directory+"farmer_linearized_nodedata_cplex.out",this_test_file_directory+"farmer_linearized_nodedata_cplex.baseline", filter=filter_time_and_data_dirs)       
     192        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_linearized_nodedata_cplex.out",this_test_file_directory+"farmer_linearized_nodedata_cplex.baseline", filter=filter_time_and_data_dirs)       
    193193
    194194    @unittest.skipIf(not gurobi_available, "The 'gurobi' executable is not available")
     
    205205        pyutilib.misc.reset_redirect()
    206206        self.cleanup()               
    207         self.failUnlessFileEqualsBaseline(this_test_file_directory+"farmer_linearized_nodedata_gurobi.out",this_test_file_directory+"farmer_linearized_nodedata_gurobi.baseline", filter=filter_time_and_data_dirs)       
     207        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_linearized_nodedata_gurobi.out",this_test_file_directory+"farmer_linearized_nodedata_gurobi.baseline", filter=filter_time_and_data_dirs)       
    208208
    209209    @unittest.skipIf(not cplex_available, "The 'cplex' executable is not available")
     
    226226        pyutilib.misc.reset_redirect()
    227227        self.cleanup()       
    228         self.failUnlessFileEqualsBaseline(this_test_file_directory+"sizes3_quadratic_cplex.out",this_test_file_directory+"sizes3_quadratic_cplex.baseline", filter=filter_time_and_data_dirs)
     228        self.assertFileEqualsBaseline(this_test_file_directory+"sizes3_quadratic_cplex.out",this_test_file_directory+"sizes3_quadratic_cplex.baseline", filter=filter_time_and_data_dirs)
    229229
    230230    @unittest.skipIf(not gurobi_available, "The 'gurobi' executable is not available")
     
    247247        pyutilib.misc.reset_redirect()
    248248        self.cleanup()
    249         self.failUnlessFileEqualsBaseline(this_test_file_directory+"sizes3_quadratic_gurobi.out",this_test_file_directory+"sizes3_quadratic_gurobi.baseline", filter=filter_time_and_data_dirs)
     249        self.assertFileEqualsBaseline(this_test_file_directory+"sizes3_quadratic_gurobi.out",this_test_file_directory+"sizes3_quadratic_gurobi.baseline", filter=filter_time_and_data_dirs)
    250250
    251251    @unittest.skipIf(not cplex_available, "The 'cplex' executable is not available")
     
    266266        pyutilib.misc.reset_redirect()
    267267        self.cleanup()               
    268         self.failUnlessFileEqualsBaseline(this_test_file_directory+"networkflow1ef10_quadratic_cplex.out",this_test_file_directory+"networkflow1ef10_quadratic_cplex.baseline", filter=filter_time_and_data_dirs)
     268        self.assertFileEqualsBaseline(this_test_file_directory+"networkflow1ef10_quadratic_cplex.out",this_test_file_directory+"networkflow1ef10_quadratic_cplex.baseline", filter=filter_time_and_data_dirs)
    269269
    270270    @unittest.skipIf(not gurobi_available, "The 'gurobi' executable is not available")
     
    285285        pyutilib.misc.reset_redirect()
    286286        self.cleanup()       
    287         self.failUnlessFileEqualsBaseline(this_test_file_directory+"networkflow1ef10_quadratic_gurobi.out",this_test_file_directory+"networkflow1ef10_quadratic_gurobi.baseline", filter=filter_time_and_data_dirs)
     287        self.assertFileEqualsBaseline(this_test_file_directory+"networkflow1ef10_quadratic_gurobi.out",this_test_file_directory+"networkflow1ef10_quadratic_gurobi.baseline", filter=filter_time_and_data_dirs)
    288288
    289289    def test_farmer_ef(self):
     
    298298        pyutilib.misc.reset_redirect()
    299299        self.cleanup()               
    300         self.failUnlessFileEqualsBaseline(this_test_file_directory+"farmer_ef.out",this_test_file_directory+"farmer_ef.baseline.out", filter=filter_time_and_data_dirs)
    301         self.failUnlessFileEqualsBaseline(ef_output_file,this_test_file_directory+"farmer_ef.baseline.lp")
     300        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_ef.out",this_test_file_directory+"farmer_ef.baseline.out", filter=filter_time_and_data_dirs)
     301        self.assertFileEqualsBaseline(ef_output_file,this_test_file_directory+"farmer_ef.baseline.lp")
    302302
    303303    def test_hydro_ef(self):
     
    312312        pyutilib.misc.reset_redirect()
    313313        self.cleanup()               
    314         self.failUnlessFileEqualsBaseline(this_test_file_directory+"hydro_ef.out",this_test_file_directory+"hydro_ef.baseline.out", filter=filter_time_and_data_dirs)
    315         self.failUnlessFileEqualsBaseline(ef_output_file,this_test_file_directory+"hydro_ef.baseline.lp")
     314        self.assertFileEqualsBaseline(this_test_file_directory+"hydro_ef.out",this_test_file_directory+"hydro_ef.baseline.out", filter=filter_time_and_data_dirs)
     315        self.assertFileEqualsBaseline(ef_output_file,this_test_file_directory+"hydro_ef.baseline.lp")
    316316
    317317    def test_sizes3_ef(self):
     
    326326        pyutilib.misc.reset_redirect()
    327327        self.cleanup()               
    328         self.failUnlessFileEqualsBaseline(this_test_file_directory+"sizes3_ef.out",this_test_file_directory+"sizes3_ef.baseline.out", filter=filter_time_and_data_dirs)
    329         self.failUnlessFileEqualsBaseline(ef_output_file,this_test_file_directory+"sizes3_ef.baseline.lp.gz")
     328        self.assertFileEqualsBaseline(this_test_file_directory+"sizes3_ef.out",this_test_file_directory+"sizes3_ef.baseline.out", filter=filter_time_and_data_dirs)
     329        self.assertFileEqualsBaseline(ef_output_file,this_test_file_directory+"sizes3_ef.baseline.lp.gz")
    330330
    331331    def test_networkflow1ef10_ef(self):
     
    340340        pyutilib.misc.reset_redirect()
    341341        self.cleanup()               
    342         self.failUnlessFileEqualsBaseline(this_test_file_directory+"networkflow1ef10_ef.out",this_test_file_directory+"networkflow1ef10_ef.baseline.out", filter=filter_time_and_data_dirs)
    343         self.failUnlessFileEqualsBaseline(ef_output_file,this_test_file_directory+"networkflow1ef10_ef.baseline.lp.gz")
     342        self.assertFileEqualsBaseline(this_test_file_directory+"networkflow1ef10_ef.out",this_test_file_directory+"networkflow1ef10_ef.baseline.out", filter=filter_time_and_data_dirs)
     343        self.assertFileEqualsBaseline(ef_output_file,this_test_file_directory+"networkflow1ef10_ef.baseline.lp.gz")
    344344
    345345    def test_farmer_ef_cvar(self):
     
    354354        pyutilib.misc.reset_redirect()
    355355        self.cleanup()               
    356         self.failUnlessFileEqualsBaseline(this_test_file_directory+"farmer_ef_cvar.out",this_test_file_directory+"farmer_ef_cvar.baseline.out", filter=filter_time_and_data_dirs)
    357         self.failUnlessFileEqualsBaseline(ef_output_file,this_test_file_directory+"farmer_ef_cvar.baseline.lp")
     356        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_ef_cvar.out",this_test_file_directory+"farmer_ef_cvar.baseline.out", filter=filter_time_and_data_dirs)
     357        self.assertFileEqualsBaseline(ef_output_file,this_test_file_directory+"farmer_ef_cvar.baseline.lp")
    358358
    359359TestPH = unittest.category('nightly', 'performance')(TestPH)
Note: See TracChangeset for help on using the changeset viewer.