Salome HOME
style: black format
[tools/sat.git] / test / test_sat5_0 / compilation / test_configure.py
index 9d995a297e639b8e8c653cd5d59caa65839d00bf..c9ac3d70127c12a477ca642b3caccf1da79332d2 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-#-*- coding:utf-8 -*-
+# -*- coding:utf-8 -*-
 
 #  Copyright (C) 2010-2018  CEA/DEN
 #
@@ -24,6 +24,7 @@ import unittest
 import src.product
 from src.salomeTools import Sat
 
+
 class TestCase(unittest.TestCase):
     """Test of the configure command"""
 
@@ -35,76 +36,86 @@ class TestCase(unittest.TestCase):
 
     def test_010(self):
         # Test the configure command with a product in cmake
-        OK = 'KO'
+        OK = "KO"
 
-        appli = 'appli-test'
-        product_name = 'PRODUCT_GIT'
+        appli = "appli-test"
+        product_name = "PRODUCT_GIT"
 
         sat = Sat()
-                            
-        sat.prepare(appli + ' --product ' + product_name)
-        expected_build_dir = src.product.get_product_config(sat.cfg, product_name).build_dir
-        expected_file_path = os.path.join(expected_build_dir, 'CMakeCache.txt')
-       
-        sat.configure(appli + ' --product ' + product_name)
-        
+
+        sat.prepare(appli + " --product " + product_name)
+        expected_build_dir = src.product.get_product_config(
+            sat.cfg, product_name
+        ).build_dir
+        expected_file_path = os.path.join(expected_build_dir, "CMakeCache.txt")
+
+        sat.configure(appli + " --product " + product_name)
+
         if os.path.exists(os.path.join(expected_build_dir, expected_file_path)):
-            OK = 'OK'         
+            OK = "OK"
         # pyunit method to compare 2 str
-        self.assertEqual(OK, 'OK')
+        self.assertEqual(OK, "OK")
 
     def test_020(self):
         # Test the configure command with a product in autotools
-        OK = 'KO'
+        OK = "KO"
 
-        appli = 'appli-test'
-        product_name = 'PRODUCT_CVS'
+        appli = "appli-test"
+        product_name = "PRODUCT_CVS"
 
         sat = Sat()
-                            
-        sat.prepare(appli + ' --product ' + product_name)
-        expected_build_dir = src.product.get_product_config(sat.cfg, product_name).build_dir
-        expected_file_path = os.path.join(expected_build_dir, 'config.log')
-       
-        sat.configure(appli + ' --product ' + product_name)
-        
+
+        sat.prepare(appli + " --product " + product_name)
+        expected_build_dir = src.product.get_product_config(
+            sat.cfg, product_name
+        ).build_dir
+        expected_file_path = os.path.join(expected_build_dir, "config.log")
+
+        sat.configure(appli + " --product " + product_name)
+
         if os.path.exists(os.path.join(expected_build_dir, expected_file_path)):
-            OK = 'OK'         
+            OK = "OK"
         # pyunit method to compare 2 str
-        self.assertEqual(OK, 'OK')
+        self.assertEqual(OK, "OK")
 
     def test_030(self):
         # Test the configure command with a product in script mode
-        OK = 'KO'
+        OK = "KO"
 
-        appli = 'appli-test'
-        product_name = 'Python'
+        appli = "appli-test"
+        product_name = "Python"
 
         sat = Sat()
-                            
-        sat.prepare(appli + ' --product ' + product_name)
-        expected_build_dir = src.product.get_product_config(sat.cfg, product_name).build_dir
-      
-        sat.configure(appli + ' --product ' + product_name)
-        
+
+        sat.prepare(appli + " --product " + product_name)
+        expected_build_dir = src.product.get_product_config(
+            sat.cfg, product_name
+        ).build_dir
+
+        sat.configure(appli + " --product " + product_name)
+
         if os.path.exists(expected_build_dir):
-            OK = 'OK'         
+            OK = "OK"
         # pyunit method to compare 2 str
-        self.assertEqual(OK, 'OK')
+        self.assertEqual(OK, "OK")
 
     def test_040(self):
         # Test the 'sat -h configure'
         OK = "KO"
 
         import configure
-        
-        if "The configure command executes in the build directory" in configure.description():
+
+        if (
+            "The configure command executes in the build directory"
+            in configure.description()
+        ):
             OK = "OK"
 
         # pyunit method to compare 2 str
         self.assertEqual(OK, "OK")
 
+
 # test launch
-if __name__ == '__main__':
+if __name__ == "__main__":
     unittest.main()
     pass