Salome HOME
style: black format
[tools/sat.git] / test / test_sat5_0 / environ / test_environ.py
index 3a63fd5afd80269b92d26870b440e9a4aa14c277..868957495d12b8dbb3067f8892191a5ca4169abd 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-#-*- coding:utf-8 -*-
+# -*- coding:utf-8 -*-
 
 #  Copyright (C) 2010-2018  CEA/DEN
 #
@@ -23,17 +23,18 @@ import unittest
 
 from src.salomeTools import Sat
 
+
 class TestSource(unittest.TestCase):
     """Test of the environ command"""
-    
+
     def test_010(self):
         # Test the environ command without any option
-        OK = 'KO'
-        
-        appli = 'appli-test'
+        OK = "KO"
+
+        appli = "appli-test"
+
+        file_env_name = "env_launch.sh"
 
-        file_env_name = 'env_launch.sh'
-        
         sat = Sat()
         sat.config(appli)
 
@@ -45,18 +46,18 @@ class TestSource(unittest.TestCase):
         sat.environ(appli)
 
         if os.path.exists(expected_file_path):
-            OK = 'OK'
-        self.assertEqual(OK, 'OK')
+            OK = "OK"
+        self.assertEqual(OK, "OK")
 
     def test_020(self):
         # Test the environ command with option '--products'
-        OK = 'KO'
-        
-        appli = 'appli-test'
-        product_name = 'PRODUCT_GIT'
-        
-        file_env_name = 'env_launch.sh'
-        
+        OK = "KO"
+
+        appli = "appli-test"
+        product_name = "PRODUCT_GIT"
+
+        file_env_name = "env_launch.sh"
+
         sat = Sat()
         sat.config(appli)
 
@@ -65,49 +66,49 @@ class TestSource(unittest.TestCase):
         if os.path.exists(expected_file_path):
             os.remove(expected_file_path)
 
-        sat.environ(appli + ' --products ' + product_name)
+        sat.environ(appli + " --products " + product_name)
 
         if os.path.exists(expected_file_path):
-            OK = 'OK'
-        self.assertEqual(OK, 'OK')        
+            OK = "OK"
+        self.assertEqual(OK, "OK")
 
     def test_030(self):
         # Test the environ command with option --target
-        OK = 'KO'
-        
-        appli = 'appli-test'
-        
-        file_env_name = 'env_launch.sh'
-        
+        OK = "KO"
+
+        appli = "appli-test"
+
+        file_env_name = "env_launch.sh"
+
         sat = Sat()
         sat.config(appli)
 
-        expected_file_path = os.path.join('.', file_env_name)
-        expected_file_path2 = os.path.join('.', 'env_build.sh')
+        expected_file_path = os.path.join(".", file_env_name)
+        expected_file_path2 = os.path.join(".", "env_build.sh")
 
         if os.path.exists(expected_file_path):
             os.remove(expected_file_path)
 
-        sat.environ(appli + ' --target .')
+        sat.environ(appli + " --target .")
 
         if os.path.exists(expected_file_path):
-            OK = 'OK'
+            OK = "OK"
 
         if os.path.exists(expected_file_path):
             os.remove(expected_file_path)
             os.remove(expected_file_path2)
 
         # pyunit method to compare 2 str
-        self.assertEqual(OK, 'OK') 
+        self.assertEqual(OK, "OK")
 
     def test_040(self):
         # Test the environ command with option --prefix
-        OK = 'KO'
-        
-        appli = 'appli-test'
-        prefix = 'TEST'
-        file_env_name = prefix + '_launch.sh'
-        
+        OK = "KO"
+
+        appli = "appli-test"
+        prefix = "TEST"
+        file_env_name = prefix + "_launch.sh"
+
         sat = Sat()
         sat.config(appli)
 
@@ -116,20 +117,20 @@ class TestSource(unittest.TestCase):
         if os.path.exists(expected_file_path):
             os.remove(expected_file_path)
 
-        sat.environ(appli + ' --prefix ' + prefix)
+        sat.environ(appli + " --prefix " + prefix)
 
         if os.path.exists(expected_file_path):
-            OK = 'OK'
-        self.assertEqual(OK, 'OK') 
+            OK = "OK"
+        self.assertEqual(OK, "OK")
 
     def test_050(self):
         # Test the environ command with option --shell
-        OK = 'KO'
-        
-        appli = 'appli-test'
-        shell = 'bat'
-        file_env_name = 'env_launch.bat'
-        
+        OK = "KO"
+
+        appli = "appli-test"
+        shell = "bat"
+        file_env_name = "env_launch.bat"
+
         sat = Sat()
         sat.config(appli)
 
@@ -138,13 +139,14 @@ class TestSource(unittest.TestCase):
         if os.path.exists(expected_file_path):
             os.remove(expected_file_path)
 
-        sat.environ(appli + ' --shell ' + shell)
+        sat.environ(appli + " --shell " + shell)
 
         if os.path.exists(expected_file_path):
-            OK = 'OK'
-        self.assertEqual(OK, 'OK') 
+            OK = "OK"
+        self.assertEqual(OK, "OK")
+
 
 # test launch
-if __name__ == '__main__':
+if __name__ == "__main__":
     unittest.main()
     pass