Changeset 5065


Ignore:
Timestamp:
10/09/11 15:01:11 (3 years ago)
Author:
jwatson
Message:

Added CPLEX version of recently added PySP test.

Location:
coopr.pysp/trunk/coopr/pysp/tests/unit
Files:
1 added
1 edited

Legend:

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

    r5063 r5065  
    123123        self.cleanup() 
    124124        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_cplex.out",this_test_file_directory+"farmer_quadratic_cplex.baseline", filter=filter_time_and_data_dirs) 
     125 
     126    @unittest.skipIf(not cplex_available, "The 'cplex' executable is not available") 
     127    def test_farmer_quadratic_nonnormalized_termdiff_cplex(self): 
     128        farmer_examples_dir = pysp_examples_dir + "farmer" 
     129        model_dir = farmer_examples_dir + os.sep + "models" 
     130        instance_dir = farmer_examples_dir + os.sep + "scenariodata" 
     131        argstring = "runph --solver=cplex --solver-manager=serial --model-directory="+model_dir+" --instance-directory="+instance_dir+" --enable-termdiff-convergence --termdiff-threshold=0.01" 
     132        print "Testing command: " + argstring 
     133 
     134        pyutilib.misc.setup_redirect(this_test_file_directory+"farmer_quadratic_nonnormalized_termdiff_cplex.out") 
     135        args = string.split(argstring) 
     136        coopr.pysp.phinit.main(args=args) 
     137        pyutilib.misc.reset_redirect() 
     138        self.cleanup() 
     139        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_nonnormalized_termdiff_cplex.out",this_test_file_directory+"farmer_quadratic_nonnormalized_termdiff_cplex.baseline", filter=filter_time_and_data_dirs)         
    125140 
    126141    @unittest.skipIf(not cplex_available or not mpirun_available, "Either the 'cplex' executable is not available or the 'mpirun' executable is not available") 
Note: See TracChangeset for help on using the changeset viewer.