From f40fdc8fe303eacc730b52e090c4a0ace4e9b363 Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Mon, 4 Nov 2019 14:48:36 +0100 Subject: [PATCH] ajout test de construction --- Tests/testConstruction/.useCaseAssd.py.swp | Bin 0 -> 16384 bytes Tests/testConstruction/avecDesAssd.py | 44 ++++++++ Tests/testConstruction/cata_Assd.py | 1 + Tests/testConstruction/cata_Assd_user.py | 1 + Tests/testConstruction/comm_avec_userASSD.py | 1 + .../comm_avec_userASSD.py_orig | 6 ++ Tests/testConstruction/creeAssd.py | 100 ++++++++++++++++++ Tests/testConstruction/litCommAvecAssd.py | 50 +++++++++ Tests/testConstruction/metier.py | 21 ++++ 9 files changed, 224 insertions(+) create mode 100644 Tests/testConstruction/.useCaseAssd.py.swp create mode 100644 Tests/testConstruction/avecDesAssd.py create mode 120000 Tests/testConstruction/cata_Assd.py create mode 120000 Tests/testConstruction/cata_Assd_user.py create mode 120000 Tests/testConstruction/comm_avec_userASSD.py create mode 100644 Tests/testConstruction/comm_avec_userASSD.py_orig create mode 100755 Tests/testConstruction/creeAssd.py create mode 100755 Tests/testConstruction/litCommAvecAssd.py create mode 100644 Tests/testConstruction/metier.py diff --git a/Tests/testConstruction/.useCaseAssd.py.swp b/Tests/testConstruction/.useCaseAssd.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..876f185785cf89b3365b467cc8c11309934844e7 GIT binary patch literal 16384 zcmeI2UyK_^9mhANh5jKeDhP>+hhHvI?E~N1zDsjSu0}XMUutx|yPWNm6QtJKJ3dcX z@47p)cQqg?@d#1`2$eV95JCKTKs>-h5s6y$t)d`QB;KH^5J=Dhg%+tC-x;CYoD;NeZaD=ees(YKYZ`+ty3Setm5gDx#?3X zWBlfdes1>U$=MSp$Cvw3Y%qJi{>V8l%N^c!L_Ksi9PVYAKFijbkRmJbTMB$3!>BEJ z;AbPjN{(PfAzZsZ7~hJ?H3}F7_9zg^&eW-+*35K1r}BINV0|A+Vge|o^Oeg%F6egHg>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)xMk1iI?D4R@%$VO;P|%V!{Ix_RxLTc zn+?!7nlB*$LcZR`ty*c4rgOR3DXeTWSjWoq3$*(1JjzUcY)Y+i++ROK`mdhqkvIhuL8LBK_Y$+_cluzIIzmt%;fFZVagsJ s#%A8M7KgER;Csh$l~vxs4&C)eb8OkMneVOv9~8jjhM@8ip+=7W3k$%iyZ`_I literal 0 HcmV?d00001 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) -- 2.39.2