Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / test.squish / suite_OBJECT_BROWSER / tst_ACTIVE_DOC_MANAGEMENT / test.py
index 3ff7857ef756e0bac4a172f89cc4d980808ca536..d9418df10fa9990d17fe058a57781df64512a12a 100644 (file)
@@ -1,4 +1,24 @@
-#[tested functionality] 
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+#[tested functionality]
 
 ENABLE_COLOR='#FF000000'
 DISABLE_COLOR='#FFC0C0C0'
@@ -6,9 +26,9 @@ DISABLE_COLOR='#FFC0C0C0'
 def checkPartActivatedState(scenario):
     #[step] Check that Part is activated
     allPartSetElements = [
-                "Parameters (0)", 
-                "Constructions (4)", 
-                "Constructions (4).Origin", 
+                "Parameters (0)",
+                "Constructions (4)",
+                "Constructions (4).Origin",
                 "Constructions (4).YOZ",
                 "Constructions (4).XOZ",
                 "Constructions (4).XOY",
@@ -18,18 +38,18 @@ def checkPartActivatedState(scenario):
         test.compare(DISABLE_COLOR, waitForObjectItem(":Object browser_XGUI_DataTree", element).foregroundColor, "%s is disabled after: %s" % (element, scenario))
 
     partElements = [
-                "Part\\_1", 
+                "Part\\_1",
                 "Part\\_1.Parameters (0)",
                 "Part\\_1.Constructions (0)",
                 "Part\\_1.Bodies (0)"]
     for element in partElements:
         test.compare(ENABLE_COLOR, waitForObjectItem(":Object browser_XGUI_DataTree", element).foregroundColor, "%s is enabled after: %s" % (element, scenario))
-    
+
     #[step] Check that Part tree is unfolded
     test.compare(False, waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1").collapsed, "Part is unfolded after: %s" % scenario)
 
 def checkPartDeactivatedState(scenario):
-    #[step] Check that Part id disabled and folded 
+    #[step] Check that Part id disabled and folded
     partElements = [
                 "Part\\_1.Parameters (0)",
                 "Part\\_1.Constructions (0)",
@@ -38,12 +58,12 @@ def checkPartDeactivatedState(scenario):
         test.compare(DISABLE_COLOR, waitForObjectItem(":Object browser_XGUI_DataTree", element).foregroundColor, "%s is disabled after: %s" % (element, scenario))
     test.compare(ENABLE_COLOR, waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1").foregroundColor, "Part is enable after: %s" % scenario)
     test.compare(True, waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1").collapsed, "Part is unfolded after: %s" % scenario)
-    
-    #[step] Check that PartSet is enabled  
+
+    #[step] Check that PartSet is enabled
     allPartSetElements = [
-                "Parameters (0)", 
-                "Constructions (4)", 
-                "Constructions (4).Origin", 
+                "Parameters (0)",
+                "Constructions (4)",
+                "Constructions (4).Origin",
                 "Constructions (4).YOZ",
                 "Constructions (4).XOZ",
                 "Constructions (4).XOY",
@@ -54,18 +74,18 @@ def checkPartDeactivatedState(scenario):
 
 def main():
     source(findFile("scripts", "common.py"))
-    
+
     startApplication("salome_run.sh")
     activate_SHAPER()
 
     #[step] Check that default elements are enabled: Parameters (0), Constructions (4), Parts (0)
     waitForObjectItem(":Object browser_XGUI_DataTree", "Constructions (4)")
     clickItem(":Object browser_XGUI_DataTree", "Constructions (4)", -10, 10, 0, Qt.LeftButton)
-     
+
     allPartSetElements = [
-                "Parameters (0)", 
-                "Constructions (4)", 
-                "Constructions (4).Origin", 
+                "Parameters (0)",
+                "Constructions (4)",
+                "Constructions (4).Origin",
                 "Constructions (4).YOZ",
                 "Constructions (4).XOZ",
                 "Constructions (4).XOY",
@@ -76,32 +96,32 @@ def main():
     #[step] Create Part
     activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Part"))
     activateItem(waitForObjectItem(":Part_QMenu", "New part"))
-     
+
     checkPartActivatedState("Part creation")
-    #[step] Deactivate part by double click 
+
+    #[step] Deactivate part by double click
     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1")
     doubleClickItem(":Object browser_XGUI_DataTree", "Part\\_1", 10, 10, 0, Qt.LeftButton)
 
     checkPartDeactivatedState("Part deactivation by double click")
 
-    #[step] Activate part by double click 
+    #[step] Activate part by double click
     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1")
     doubleClickItem(":Object browser_XGUI_DataTree", "Part\\_1", 10, 10, 0, Qt.LeftButton)
 
     checkPartActivatedState("Part activation by double click")
 
-    #[step] Check that Activate is disabled in Part context menu  
+    #[step] Check that Activate is disabled in Part context menu
     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1", 10, 10, 0)
     test.compare(False, findMenuItem(waitForObject(":_QMenu"), "Activate").enabled, "Activate is disabled on active Part")
 
-    #[step] Deactivate part by context menu on PartSet 
+    #[step] Deactivate part by context menu on PartSet
     openContextMenu(waitForObject(":Object browser.Part set_XGUI_ActiveDocLbl"), 10, 10, 0)
     activateItem(waitForObjectItem(":_QMenu", "Activate"))
-    
+
     checkPartDeactivatedState("Part deactivation by context menu on PartSet")
 
-    #[step] Check that Activate is disabled in PartSet context menu  
+    #[step] Check that Activate is disabled in PartSet context menu
     openContextMenu(waitForObject(":Object browser.Part set_XGUI_ActiveDocLbl"), 10, 10, 0)
     test.compare(False, findMenuItem(waitForObject(":_QMenu"), "Activate").enabled, "Activate is disabled on active PartSet")