4 # Copyright (C) 2010-2018 CEA/DEN
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 from src.salomeTools import Sat
26 from unittestpy.tools import outRedirection
28 class TestCase(unittest.TestCase):
29 """sat config -v VARS.python"""
32 # Test the display of the right value of 'sat config -v VARS.python'
36 my_out = outRedirection()
40 sat.config('-v VARS.python')
42 # stop output redirection
43 my_out.end_redirection()
46 res = my_out.read_results()
49 if platform.python_version() in res:
51 self.assertEqual(OK, 'OK')
54 # Test the display of the right value of 'sat config -s'
58 my_out = outRedirection()
64 # stop output redirection
65 my_out.end_redirection()
68 res = my_out.read_results()
73 self.assertEqual(OK, 'OK')
76 # Test the display of the right value of 'sat config --info'
77 application = 'appli-test'
78 product = 'PRODUCT_DEV'
83 my_out = outRedirection()
87 sat.config(application + ' --info ' + product)
89 # stop output redirection
90 my_out.end_redirection()
93 res = my_out.read_results()
96 if 'compilation method = cmake' in res:
98 self.assertEqual(OK, 'OK')
101 if __name__ == '__main__':