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
25 testdir = os.path.dirname(os.path.realpath(__file__))
26 sys.path.append(os.path.join(testdir, '..', '..', 'src'))
27 sys.path.append(os.path.join(testdir, '..', '..', 'test', '_testTools'))
29 from salomeTools import salomeTools
30 from tools import outRedirection
33 class TestConfig(unittest.TestCase):
37 def test_option_value(self):
38 '''Test the display of the right value of "sat config -v VARS.hostname"
44 my_out = outRedirection()
48 sat.config('-v VARS.hostname')
50 # stop output redirection
51 my_out.end_redirection()
54 res = my_out.read_results()
56 if platform.node() in res:
59 # pyunit method to compare 2 str
60 self.assertEqual(OK, "OK")
62 def test_option_list(self):
63 '''Test the display of the right value of "sat config -l"
69 my_out = outRedirection()
75 # stop output redirection
76 my_out.end_redirection()
79 res = my_out.read_results()
82 if "ERROR" not in res:
85 # pyunit method to compare 2 str
86 self.assertEqual(OK, "OK")
89 if __name__ == '__main__':