1 # Copyright (C) 2014-2020 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 Unit test for testing the Part sub-shapes naming, described in the issue 1064
25 #=========================================================================
26 # Initialization of the test
27 #=========================================================================
28 from ModelAPI import *
29 from GeomDataAPI import *
30 from GeomAlgoAPI import *
33 __updated__ = "2015-10-16"
35 aSession = ModelAPI_Session.get()
37 #=========================================================================
38 # Create a sketch triangle in PartSet
39 #=========================================================================
40 aPartSet = aSession.moduleDocument()
41 aSession.startOperation()
42 aSketchFeature = featureToCompositeFeature(aPartSet.addFeature("Sketch"))
43 aXOYPlane = objectToResult(aPartSet.objectByName("Construction", "XOY"))
44 aSketchFeature.selection("External").setValue(aXOYPlane, None)
45 aFeatureData = aSketchFeature.data()
46 anArray = aFeatureData.addAttribute("IntArray_1", "IntArray")
47 aFeatureData.intArray("IntArray_1").setSize(5)
48 aSession.finishOperation()
50 assert(aFeatureData.intArray("IntArray_1").size() == 5)
52 #=========================================================================
54 #=========================================================================