Back to index

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

Classes

class  Enumerate

Functions

def TEST_simple
def TEST_createFromList
def TEST_createFromString
def TEST_contains
def TEST_isValid
def TEST_offset
def TEST_listvalues
def TEST_keyOf

Variables

string __author__ = "gboulant"
string __date__ = "$1 avr. 2010 09:08:02$"

Function Documentation

Definition at line 132 of file enumerate.py.

00132 
00133 def TEST_contains():
00134     codes = Enumerate([
00135         'KERNEL', # This should take the value 0
00136         'GUI', # This should take the value 1
00137         'GEOM', # ...
00138         'MED',
00139         'SMESH'])
00140 
00141     print "VISU in enumerate?", codes.contains("VISU")
00142     if (not codes.contains("VISU")):
00143         return True
00144     else:
00145         return False

Definition at line 105 of file enumerate.py.

00105 
00106 def TEST_createFromList():
00107     codes = Enumerate([
00108         'KERNEL', # This should take the value 0
00109         'GUI', # This should take the value 1
00110         'GEOM', # ...
00111         'MED',
00112         'SMESH'])
00113 
00114     print codes.KERNEL
00115     print codes.GEOM
00116     if (codes.KERNEL == 0 and codes.GEOM == 2):
00117         return True
00118     else:
00119         return False

Definition at line 120 of file enumerate.py.

00120 
00121 def TEST_createFromString():
00122     aList = "KERNEL GUI GEOM MED"
00123 
00124     codes = Enumerate(aList.split())
00125 
00126     print codes.KERNEL
00127     print codes.GEOM
00128     if (codes.KERNEL == 0 and codes.GEOM == 2):
00129         return True
00130     else:
00131         return False

Definition at line 146 of file enumerate.py.

00146 
00147 def TEST_isValid():
00148     codes = Enumerate([
00149         'KERNEL', # This should take the value 0
00150         'GUI', # This should take the value 1
00151         'GEOM', # ...
00152         'MED',
00153         'SMESH'])
00154 
00155     if (not codes.isValid(23)):
00156         return True
00157     else:
00158         return False

Definition at line 187 of file enumerate.py.

00187 
00188 def TEST_keyOf():
00189     codes = Enumerate([
00190         'KERNEL', # This should take the value 0
00191         'GUI', # This should take the value 1
00192         'GEOM', # ...
00193         'MED',
00194         'SMESH'])
00195 
00196     if ( codes.keyOf(codes.KERNEL) != 'KERNEL' or
00197          codes.keyOf(codes.GUI) != 'GUI' or
00198          codes.keyOf(codes.GEOM) != 'GEOM' or
00199          codes.keyOf(codes.MED) != 'MED' or
00200          codes.keyOf(codes.SMESH) != 'SMESH'):
00201             return False
00202     return True

Definition at line 174 of file enumerate.py.

00174 
00175 def TEST_listvalues():
00176     codes = Enumerate([
00177         'KERNEL', # This should take the value 0
00178         'GUI', # This should take the value 1
00179         'GEOM', # ...
00180         'MED',
00181         'SMESH'], offset=20)
00182 
00183     print codes.listvalues()
00184     if codes.listvalues() != [20, 21, 22, 23, 24]:
00185         return False
00186     return True

Definition at line 159 of file enumerate.py.

00159 
00160 def TEST_offset():
00161     codes = Enumerate([
00162         'KERNEL', # This should take the value 0
00163         'GUI', # This should take the value 1
00164         'GEOM', # ...
00165         'MED',
00166         'SMESH'], offset=20)
00167 
00168     print codes.KERNEL
00169     print codes.GEOM
00170     if (codes.KERNEL == 20 and codes.GEOM == 22):
00171         return True
00172     else:
00173         return False

Definition at line 97 of file enumerate.py.

00097 
00098 def TEST_simple():
00099     TYPES_LIST = Enumerate([
00100         'SEP',
00101         'OTHER'
00102     ])
00103     print TYPES_LIST.listvalues()
00104     return True


Variable Documentation

Definition at line 21 of file enumerate.py.

string KERNEL_PY.kernel.enumerate.__date__ = "$1 avr. 2010 09:08:02$"

Definition at line 22 of file enumerate.py.