Beispiel #1
0
    def testOptionRetrieval01(self):

        lp = LP()

        self.assert_(lp.getOption("presolve_rows") == False)

        lp.setOption("presolve_rows", True)

        self.assert_(lp.getOption("presolve_rows") == True)
        self.assert_(lp.getOptionDict()["presolve_rows"] == True)
Beispiel #2
0
    def testOptionRetrieval01(self):

        lp = LP()

        self.assert_(lp.getOption("presolve_rows") == False)

        lp.setOption("presolve_rows", True)
        
        self.assert_(lp.getOption("presolve_rows") == True)
        self.assert_(lp.getOptionDict()["presolve_rows"] == True)
Beispiel #3
0
    def testOptionRetrieval_BadValues_02(self):

        lp = LP()

        self.assert_(lp.getOption("presolve_rows") == False)

        self.assertRaises(TypeError,
                          lambda: lp.setOption(None, True, presolve_rows = True))

        self.assert_(lp.getOption("presolve_rows") == False)
        self.assert_(lp.getOptionDict()["presolve_rows"] == False)
Beispiel #4
0
    def testOptionRetrieval_BadValues_01(self):

        lp = LP()

        self.assert_(lp.getOption("presolve_rows") == False)

        self.assertRaises(ValueError,
                          lambda: lp.setOption("presolve_rows", True, bad_option = None))

        self.assert_(lp.getOption("presolve_rows") == False)
        self.assert_(lp.getOptionDict()["presolve_rows"] == False)
Beispiel #5
0
    def testOptionRetrieval_BadValues_02(self):

        lp = LP()

        self.assert_(lp.getOption("presolve_rows") == False)

        self.assertRaises(TypeError,
                          lambda: lp.setOption(None, True, presolve_rows = True))
        
        self.assert_(lp.getOption("presolve_rows") == False)
        self.assert_(lp.getOptionDict()["presolve_rows"] == False)
Beispiel #6
0
    def testOptionRetrieval_BadValues_01(self):

        lp = LP()

        self.assert_(lp.getOption("presolve_rows") == False)

        self.assertRaises(ValueError,
                          lambda: lp.setOption("presolve_rows", True, bad_option = None))
        
        self.assert_(lp.getOption("presolve_rows") == False)
        self.assert_(lp.getOptionDict()["presolve_rows"] == False)