Salome HOME
Merge from V6_4_BR 05/12/2011
[modules/smesh.git] / src / Tools / padder / unittests / usecase_spadderPluginTester.py
1 # -*- coding: iso-8859-1 -*-
2 #  Copyright (C) 2011 EDF R&D
3 #
4 #  This library is free software; you can redistribute it and/or
5 #  modify it under the terms of the GNU Lesser General Public
6 #  License as published by the Free Software Foundation; either
7 #  version 2.1 of the License.
8 #
9 #  This library is distributed in the hope that it will be useful,
10 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 #  Lesser General Public License for more details.
13 #
14 #  You should have received a copy of the GNU Lesser General Public
15 #  License along with this library; if not, write to the Free Software
16 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 # Author(s): Guillaume Boulant (23/03/2011)
21 #
22
23 # This script illustrates the standard use case of the component
24 # SPADDERPluginTester from within a SALOME script. This component is
25 # dedicated to test purpose only
26
27 import salome
28 import SPADDERPluginTest
29
30 # We first have to update the SALOME components list by loading the
31 # SPADDER catalog (load on demand only) 
32 from salome.smesh import spadder
33 spadder.loadSpadderCatalog()
34
35 # Basic test
36 print "Basic tests"
37 c=salome.lcc.FindOrLoadComponent("FactoryServer","SPADDERPluginTester")
38 z=c.demo(2.,3.)
39
40 # Test of usage of KERNEL services from the test component
41 print "Test of usage of KERNEL services from the test component"
42 c.testkernel()
43
44 # Test of usage of SMESH engine from the test component
45 # WARN: the SMESH engine must be loaded first
46 print "Test of usage of SMESH engine from the test component"
47 import SMESH
48 salome.lcc.FindOrLoadComponent("FactoryServer","SMESH")
49 c.testsmesh(salome.myStudyId)
50
51 print "Test completed : OK"