3 # Copyright (C) 2010-2012 CEA/DEN
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 testdir = os.path.dirname(os.path.realpath(__file__))
27 sys.path.append(os.path.join(testdir, '..', '..'))
28 sys.path.append(os.path.join(testdir, '..', '_testTools'))
30 from salomeTools import Sat
31 from tools import check_proc_existence_and_kill_multi
36 class TestConfig(unittest.TestCase):
40 def test_edit_userconfig(self):
41 '''Test the launch of the editor when invoking the config -e
46 sat = Sat("-oUSER.editor='cooledit'")
48 cmd_config = threading.Thread(target=sat.config, args=('-e',))
51 time.sleep(sleep_time)
53 editor = sat.cfg.USER.editor
54 pid = check_proc_existence_and_kill_multi(editor + ".*" + "salomeTools\.pyconf", 10)
58 # pyunit method to compare 2 str
59 self.assertEqual(OK, "OK")
61 def test_edit_appli(self):
62 '''Test the launch of the editor when invoking the config -e appli-test
67 sat = Sat("-oUSER.editor='cooledit'")
69 cmd_config = threading.Thread(target=sat.config, args=('appli-test -e',))
72 time.sleep(sleep_time)
74 editor = sat.cfg.USER.editor
75 pid = check_proc_existence_and_kill_multi(editor + ".*" + "appli-test\.pyconf", 10)
79 # pyunit method to compare 2 str
80 self.assertEqual(OK, "OK")
83 if __name__ == '__main__':