From: pascale.noyret Date: Mon, 4 Nov 2019 13:48:36 +0000 (+0100) Subject: ajout test de construction X-Git-Tag: avantMenage~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f40fdc8fe303eacc730b52e090c4a0ace4e9b363;p=tools%2Feficas.git ajout test de construction --- diff --git a/Tests/testConstruction/.useCaseAssd.py.swp b/Tests/testConstruction/.useCaseAssd.py.swp new file mode 100644 index 00000000..876f1857 Binary files /dev/null and b/Tests/testConstruction/.useCaseAssd.py.swp differ diff --git a/Tests/testConstruction/avecDesAssd.py b/Tests/testConstruction/avecDesAssd.py new file mode 100644 index 00000000..d267b08d --- /dev/null +++ b/Tests/testConstruction/avecDesAssd.py @@ -0,0 +1,44 @@ +def CreeUneASSD(Unite) : + return ('toto') + +def UtiliseUneASSD(MonASSD): + print (MonASSD) + + +class maClasseUser : + def __init__(self): + print ('je cree un objet utilisateur') + + +def creeUneASSDDansUnSimp(UneSeuleASSD): + print ('je suis dans la fonction utilisateur) + + +# _______________ fin partie code metier ___________________ +# +def creeUnObjet(classe,reference,*args,**kwargs) : + if args == {} : obj=classe(**kwargs) + else : obj=classe(*args,**kwargs) + globals()[reference]=obj + +def decoratorCreeUnObjet(maFonction,maClasse): + def maFonctionAvecCreation(*args, **kwargs): + creeUnObjet(*args,**args) + maFonction(*args, **kwargs) + return maFonctionAvecCreation(*args, **kwargs) + +creeUneASSDDansUnSimp = decoratorCreeUnObjet(creeUneASSDDansUnSimp,maClasseUser) +# ------------------------------------------------------------------- + +creeUneUserASSDDansUnSimp(UneSeuleASSD='MaRef',); +UtiliseUneUserASSD(MonUserASSD=MaRef); + +#MonAssd=CreeUneASSD(Unite=1,); +#UtiliseUneASSD(MonASSD=MonAssd,); + +#MaRef=maClasseUser('MaRef') +#CreeUneUserASSDDansUnSimp(UneSeuleASSD=MaRef,); + +#UtiliseUneUserASSD(MonUserASSD='MaRef',); +#VERSION_CATALOGUE:V_0:FIN VERSION_CATALOGUE +#CHECKSUM:c908ade781fa6592ac27485ea2f9b939 -:FIN CHECKSUM diff --git a/Tests/testConstruction/cata_Assd.py b/Tests/testConstruction/cata_Assd.py new file mode 120000 index 00000000..6b47b948 --- /dev/null +++ b/Tests/testConstruction/cata_Assd.py @@ -0,0 +1 @@ +../../CatasDeTests/cata_Assd.py \ No newline at end of file diff --git a/Tests/testConstruction/cata_Assd_user.py b/Tests/testConstruction/cata_Assd_user.py new file mode 120000 index 00000000..2e1f6a84 --- /dev/null +++ b/Tests/testConstruction/cata_Assd_user.py @@ -0,0 +1 @@ +../../CatasDeTests/cata_Assd_user.py \ No newline at end of file diff --git a/Tests/testConstruction/comm_avec_userASSD.py b/Tests/testConstruction/comm_avec_userASSD.py new file mode 120000 index 00000000..f4fb34b8 --- /dev/null +++ b/Tests/testConstruction/comm_avec_userASSD.py @@ -0,0 +1 @@ +comm_avec_userASSD.comm \ No newline at end of file diff --git a/Tests/testConstruction/comm_avec_userASSD.py_orig b/Tests/testConstruction/comm_avec_userASSD.py_orig new file mode 100644 index 00000000..a50566be --- /dev/null +++ b/Tests/testConstruction/comm_avec_userASSD.py_orig @@ -0,0 +1,6 @@ + +DefinitUneGeometrie(uneFaceDeLaGeometrie='Haut',); + +DefinitUneConditionAuxLimites(laFaceDeLaCL=Haut,); +#VERSION_CATALOGUE:V_0:FIN VERSION_CATALOGUE +#CHECKSUM:03040f7bb46466807f7c4d30b8180bbf -:FIN CHECKSUM diff --git a/Tests/testConstruction/creeAssd.py b/Tests/testConstruction/creeAssd.py new file mode 100755 index 00000000..8b0f6af2 --- /dev/null +++ b/Tests/testConstruction/creeAssd.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2013 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" +lancement EFICAS ss Ihm +""" +from __future__ import absolute_import +from __future__ import print_function + +# On ajoute le path jusqu a eficas et celui ou on trouve le prefs_Code +import os, sys +sys.path.insert(0,'/home/A96028/QT5GitEficasTravail/eficas') +sys.path.insert(0,'/home/A96028/QT5GitEficasTravail/eficas/CatasDeTests') + +debug = True + +if __name__ == '__main__': + from InterfaceQT4.eficas_go import getEficasSsIhm + code='Essai' + versionCode="V2019" + + monEficasSsIhm = getEficasSsIhm(code=code,versionCode=versionCode) + monEficasSsIhm.initEditor() + monEditor = monEficasSsIhm.editor + if debug : print ('monEditor : ' , monEditor ) + + monJdc = monEditor.jdc + if debug : print ('monJdc : ' , monJdc ) + + index=-1 + + #TesteCreationASSD = True + TesteCreationASSD = 0 + if TesteCreationASSD : + index=index+1 + monJdc.addEntite('CreeUneASSD',index) + monEtape=monJdc.etapes[index] + monMC=monEtape.getChild('Unite') + monMC.setValeur(1) + monEtape.nommeSd('MonASSDCree') + print (monEtape.nom , " isValid : ", monEtape.isValid()) + + index=index+1 + monJdc.addEntite('UtiliseUneASSD',index) + monEtape=monJdc.etapes[index] + monMC=monEtape.getChild('MonASSD') + objetASSD=monMC.evalVal('MonASSDCree') + validType=monMC.verifType(objetASSD) + monMC.setValeur(objetASSD) + print (monEtape.nom , " isValid : ", monEtape.isValid()) + + TesteCreationUserASSDDansUnSimp = True + if TesteCreationUserASSDDansUnSimp : + index=index+1 + monJdc.addEntite('CreeUneUserASSDDansUnSimp',index) + monEtape=monJdc.etapes[index] + monMC=monEtape.getChild('UneSeuleASSD') + monMC.creeUserASSDetSetValeur('SIMPquiEstUneUserASSD') + monMCEnCreation = monMC + print (monEtape.nom , " isValid : ", monEtape.isValid()) + + monJdc.addEntite('UtiliseUneUserASSD',index) + monEtape=monJdc.etapes[index] + monMC=monEtape.getChild('MonUserASSD') + objetUserASSD=monMC.evalVal('SIMPquiEstUneUserASSD') + validType=monMC.verifType(objetUserASSD) + monMC.setValeur(objetUserASSD) + monMCEnUtilisation = monMC + print (monEtape.nom , " isValid : ", monEtape.isValid()) + + TesteRenommeUserASSDDansUnSimp = True + if TesteCreationUserASSDDansUnSimp : + monMCEnCreation.renommeSdCree('SimpUserAssd') + print (monMCEnUtilisation.isValid()) + + + + + + + + + diff --git a/Tests/testConstruction/litCommAvecAssd.py b/Tests/testConstruction/litCommAvecAssd.py new file mode 100755 index 00000000..d6887d00 --- /dev/null +++ b/Tests/testConstruction/litCommAvecAssd.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2013 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" +lancement EFICAS ss Ihm +""" +from __future__ import absolute_import +from __future__ import print_function + +# On ajoute le path jusqu a eficas et celui ou on trouve le prefs_Code +import os, sys +sys.path.insert(0,'/home/A96028/QT5GitEficasTravail/eficas') +sys.path.insert(0,'/home/A96028/QT5GitEficasTravail/eficas/CatasDeTests') + +debug = True + +if __name__ == '__main__': + from InterfaceQT4.eficas_go import getEficasSsIhm + code='Essai' + versionCode="V2019" + + monEficasSsIhm = getEficasSsIhm(code=code,versionCode=versionCode) + monFichier = './avecDesAssd.comm' + monHandler = monEficasSsIhm.fileOpen(monFichier) + if not monHandler : print (' souci!'); exit() + monHandler.viewJdcSource() + monHandler.viewJdcRapport() + + + + + + diff --git a/Tests/testConstruction/metier.py b/Tests/testConstruction/metier.py new file mode 100644 index 00000000..d7d0c2f6 --- /dev/null +++ b/Tests/testConstruction/metier.py @@ -0,0 +1,21 @@ +class surfaceElementaire: + def __init__(self,*tup,**args) : + print ('_____________ surfaceElementaire ______________') + print ('dans le __init__ de la classe surfaceElementaire metier') + print ('arguments : ', tup, ' ', args) + print ('_____________ fin \n\n') + + +class mesDonnees: + def __init__(self,from,string) : + pass + +data=mesDonnees +def UneFonction (*tup, **args): + + +def DefinitUneGeometrie(uneFaceDeLaGeometrie) : + print ('dans la fonction metier DefinitUneGeometrie avec uneFaceDeLaGeometrie ', uneFaceDeLaGeometrie) + +def DefinitUneConditionAuxLimites(laFaceDeLaCL) : + print ('dans la fonction metier DefinitUneConditionAuxLimites avec laFaceDeLaCL ', laFaceDeLaCL)