Back to index

salome-kernel  6.5.0
Classes | Functions | Variables
KERNEL_PY.kernel.testdata Namespace Reference

Classes

class  TestData

Functions

def TEST_getName
def TEST_useBadKey
def TEST_useBadType
def TEST_useBadRange
def TEST_serialize

Variables

string __author__ = "gboulant"
string __date__ = "$17 avr. 2010 19:44:36$"

Function Documentation

Definition at line 84 of file testdata.py.

00084 
00085 def TEST_getName():
00086     testdata = TestData()
00087     testdata.setName("Sous-epaisseur")
00088     testdata.setType(TestData.TYPES_LIST.SEP)
00089     if ( testdata.NAME != "Sous-epaisseur" ):
00090         return False
00091     return True
00092 

Definition at line 133 of file testdata.py.

00133 
00134 def TEST_serialize():
00135     import salome.kernel
00136     ref_testdata = TestData()
00137     ref_testdata.setName("The firts name")
00138     res_testdata = salome.kernel.unserialize(salome.kernel.serialize(ref_testdata))
00139 
00140     print res_testdata.getName()
00141 
00142     if res_testdata.getName() != ref_testdata.getName():
00143         return False
00144 
00145     # Is the unserialized data still functional?
00146     try:
00147         res_testdata.setName("An other name")
00148         print res_testdata.getName()
00149     except:
00150         print e
00151         return False
00152     return True

Here is the call graph for this function:

Definition at line 93 of file testdata.py.

00093 
00094 def TEST_useBadKey():
00095     testdata = TestData()
00096     try:
00097         testdata.unknown = "unknown"
00098         # This should not arrive here
00099         return False
00100     except UiException, err:
00101         print err
00102         return True

Definition at line 113 of file testdata.py.

00113 
00114 def TEST_useBadRange():
00115     testdata = TestData()
00116 
00117     try:
00118         testdata.TYPE = TestData.TYPES_LIST.SEP
00119         testdata.setType(TestData.TYPES_LIST.SEP)
00120         # This should arrive here
00121     except UiException, err:
00122         # And not here
00123         print err
00124         return False
00125 
00126     try:
00127         testdata.TYPE = 9999 # a type that does not exist in the range
00128         # This should not arrive here
00129         return False
00130     except UiException, err:
00131         print err
00132         return True

Definition at line 103 of file testdata.py.

00103 
00104 def TEST_useBadType():
00105     testdata = TestData()
00106     try:
00107         testdata.TYPE = "unknown"
00108         # This should not arrive here
00109         return False
00110     except UiException, err:
00111         print err
00112         return True


Variable Documentation

Definition at line 24 of file testdata.py.

string KERNEL_PY.kernel.testdata.__date__ = "$17 avr. 2010 19:44:36$"

Definition at line 25 of file testdata.py.