Salome HOME
Some minor changes in tests. Now the initialization plugin performs correctly in...
[modules/shaper.git] / src / ModelAPI / Test / TestResults.py
1 """
2       TestResults.py
3       Cover specific working with the data model results
4
5 """
6 #=========================================================================
7 # Initialization of the test
8 #=========================================================================
9 from ModelAPI import *
10
11 __updated__ = "2016-20-16"
12
13 aSession = ModelAPI_Session.get()
14
15 #=========================================================================
16 # Check getting the initial construction plane by name
17 #=========================================================================
18 aPartSet = aSession.moduleDocument()
19 aSession.startOperation()
20 aPlaneX = aPartSet.objectByName("Construction", "YOZ");
21 assert(aPlaneX)
22 aColors = aPlaneX.data().intArray("Color")
23 assert(aColors)
24 # default colors, not filled array
25 assert(aColors.size() == 0)
26 aColors.setSize(3)
27 aColors.setValue(0, 100)
28 aColors.setValue(1, 200)
29 aColors.setValue(2, 250)
30 assert(aColors.size() == 3)
31 assert(aColors.value(0) == 100)
32 assert(aColors.value(1) == 200)
33 assert(aColors.value(2) == 250)
34
35 aSession.finishOperation()
36