From: smh Date: Thu, 20 May 2004 12:24:23 +0000 (+0000) Subject: test on remove reference functionality X-Git-Tag: Ecole_Ete_a6~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3c979508491fbc9f325d8c483fee63ca87c7d19d;p=modules%2Fkernel.git test on remove reference functionality --- diff --git a/src/SALOME_SWIG/Makefile.in b/src/SALOME_SWIG/Makefile.in index ddd2ccfbd..2a6f6933a 100644 --- a/src/SALOME_SWIG/Makefile.in +++ b/src/SALOME_SWIG/Makefile.in @@ -38,7 +38,7 @@ LIB = libSALOME_Swigcmodule.la LIB_SRC = SWIG_DEF = libSALOME_Swig.i -EXPORT_PYSCRIPTS = libSALOME_Swig.py Help.py PyInterp.py salome.py examplevtk1.py supervisionexample.py supervisiongeomexample.py salome_shared_modules.py batchmode_salome.py test_table.py test_big_table.py test_many_objects.py import_hook.py salome_test.py +EXPORT_PYSCRIPTS = libSALOME_Swig.py Help.py PyInterp.py salome.py examplevtk1.py supervisionexample.py supervisiongeomexample.py salome_shared_modules.py batchmode_salome.py test_table.py test_big_table.py test_many_objects.py import_hook.py salome_test.py test_remove_ref.py EXPORT_SHAREDPYSCRIPTS=kernel_shared_modules.py diff --git a/src/SALOME_SWIG/test_remove_ref.py b/src/SALOME_SWIG/test_remove_ref.py new file mode 100755 index 000000000..7842a0ecd --- /dev/null +++ b/src/SALOME_SWIG/test_remove_ref.py @@ -0,0 +1,49 @@ +# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# +# +# +# File : test_remove_ref.py +# Module : SALOMEDS + +from salome import * + +myBuilder = myStudy.NewBuilder() + + +obj1 = myStudy.FindObjectID("0:1") +if obj1 is None: print "Is null obj1 " +else: print obj1.GetID() + +obj2 = myBuilder.NewObject(obj1) +print "Obj2 ID = "+obj2.GetID() + +myBuilder.Addreference(obj1, obj2) + +(f, obj3) = obj1.ReferencedObject() + +print "Ref obj ID = "+obj3.GetID() + + +myBuilder.RemoveReference(obj1) + +(f, obj4) = obj1.ReferencedObject() + +print "Ref is found ", f + \ No newline at end of file