3 Cover specific working with the data model results
6 #=========================================================================
7 # Initialization of the test
8 #=========================================================================
11 __updated__ = "2016-20-16"
13 aSession = ModelAPI_Session.get()
15 #=========================================================================
16 # Check getting the initial construction plane by name
17 #=========================================================================
18 aPartSet = aSession.moduleDocument()
19 aSession.startOperation()
20 aPlaneX = aPartSet.addFeature("Plane")
21 aPlaneX.string("creation_method").setValue("by_general_equation")
22 aPlaneX.real("A").setValue(1.)
23 aPlaneX.real("B").setValue(0.)
24 aPlaneX.real("C").setValue(0.)
25 aPlaneX.real("D").setValue(0.)
27 aSession.finishOperation()
29 aSession.startOperation()
30 aColors = aPlaneX.lastResult().data().intArray("Color")
32 # default colors, not filled array
33 assert(aColors.size() == 0)
35 aColors.setValue(0, 100)
36 aColors.setValue(1, 200)
37 aColors.setValue(2, 250)
38 assert(aColors.size() == 3)
39 assert(aColors.value(0) == 100)
40 assert(aColors.value(1) == 200)
41 assert(aColors.value(2) == 250)
42 aSession.finishOperation()
44 from salome.shaper import model
45 assert(model.checkPythonDump())