source: trunk/test/core/base/test_config.py @ 1657

Last change on this file since 1657 was 1657, checked in by wehart, 11 years ago

Removing coopr.opt-depricated, and
renaming coopr.core to coopr.opt.

Unfortunately, plugins are still not being properly loaded, so
some of the tests are failing.

File size: 1.6 KB
Line 
1#
2# Unit Tests for coopr.opt.opt_config
3#
4#
5
6import os
7import sys
8from os.path import abspath, dirname
9sys.path.insert(0, dirname(dirname(abspath(__file__)))+"/../..")
10cooprdir = dirname(abspath(__file__))+os.sep+".."+os.sep+".."+os.sep
11currdir = dirname(abspath(__file__))+os.sep
12
13import unittest
14from nose.tools import nottest
15import coopr.opt
16import pyutilib
17
18pyutilib.TempfileManager.tempdir = currdir
19
20class OptConfigDebug(unittest.TestCase):
21
22    def setUp(self):
23        pyutilib.TempfileManager.tempdir = currdir
24
25    def tearDown(self):
26        pyutilib.TempfileManager.clear_tempfiles()
27
28    def test_config1(self):
29        """
30        Read in config file opt1.cfg
31        """
32        app = pyutilib.plugin.SimpleApplication("testapp")
33        #pyutilib.plugin.PluginGlobals.pprint()
34        #app.config.summarize()
35        app.save_configuration(currdir+"opt1-out.cfg")
36        app.configure(currdir+"opt1.cfg")
37        if pyutilib.registered_executable("pico_convert"):
38            self.failUnlessEqual( pyutilib.registered_executable("pico_convert").get_path(), pyutilib.search_file("pico_convert"))
39        if pyutilib.registered_executable("glpsol"):
40            self.failUnlessEqual( pyutilib.registered_executable("glpsol").get_path(), pyutilib.search_file("glpsol"))
41        if pyutilib.registered_executable("ampl"):
42            self.failUnlessEqual( pyutilib.registered_executable("ampl").get_path(), pyutilib.search_file("ampl"))
43        if pyutilib.registered_executable("timer"):
44            self.failUnlessEqual( pyutilib.registered_executable("timer").get_path(), pyutilib.search_file("timer"))
45
46
47if __name__ == "__main__":
48   unittest.main()
Note: See TracBrowser for help on using the repository browser.