#!/usr/bin/env python
-#-*- coding:utf-8 -*-
+# -*- coding:utf-8 -*-
# Copyright (C) 2010-2018 CEA/DEN
#
from src.salomeTools import Sat
from unittestpy.tools import outRedirection
+
class TestCase(unittest.TestCase):
"""sat config -v VARS.python"""
-
+
def test_010(self):
# Test the display of the right value of 'sat config -v VARS.python'
- OK = 'KO'
+ OK = "KO"
# output redirection
my_out = outRedirection()
# The command to test
- sat = Sat('')
- sat.config('-v VARS.python')
+ sat = Sat("")
+ sat.config("-v VARS.python")
# stop output redirection
my_out.end_redirection()
# get results
res = my_out.read_results()
-
-
+
if platform.python_version() in res:
- OK = 'OK'
- self.assertEqual(OK, 'OK')
+ OK = "OK"
+ self.assertEqual(OK, "OK")
def test_020(self):
# Test the display of the right value of 'sat config -s'
- OK = 'KO'
+ OK = "KO"
# output redirection
my_out = outRedirection()
# The command to test
- sat = Sat('')
- sat.config('-s')
+ sat = Sat("")
+ sat.config("-s")
# stop output redirection
my_out.end_redirection()
# get results
res = my_out.read_results()
-
-
- if 'INTERNAL' in res:
- OK = 'OK'
- self.assertEqual(OK, 'OK')
-
+
+ if "INTERNAL" in res:
+ OK = "OK"
+ self.assertEqual(OK, "OK")
+
def test_030(self):
# Test the display of the right value of 'sat config --info'
- application = 'appli-test'
- product = 'PRODUCT_DEV'
-
- OK = 'KO'
+ application = "appli-test"
+ product = "PRODUCT_DEV"
+
+ OK = "KO"
# output redirection
my_out = outRedirection()
# The command to test
- sat = Sat('')
- sat.config(application + ' --info ' + product)
+ sat = Sat("")
+ sat.config(application + " --info " + product)
# stop output redirection
my_out.end_redirection()
# get results
res = my_out.read_results()
-
-
- if 'compilation method = cmake' in res:
- OK = 'OK'
- self.assertEqual(OK, 'OK')
+
+ if "compilation method = cmake" in res:
+ OK = "OK"
+ self.assertEqual(OK, "OK")
+
# test launch
-if __name__ == '__main__':
+if __name__ == "__main__":
unittest.main()
pass