Salome HOME
Update copyrights 2014.
[modules/smesh.git] / src / Tools / padder / unittests / usecase_spadderPluginTester.py
1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2011-2014  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, or (at your option) any later version.
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
21 # Author(s): Guillaume Boulant (23/03/2011)
22 #
23
24 # This script illustrates the standard use case of the component
25 # SPADDERPluginTester from within a SALOME script. This component is
26 # dedicated to test purpose only
27
28 import salome
29 import SPADDERPluginTest
30
31 # We first have to update the SALOME components list by loading the
32 # SPADDER catalog (load on demand only) 
33 from salome.smesh import spadder
34 spadder.loadSpadderCatalog()
35
36 # Basic test
37 print "Basic tests"
38 c=salome.lcc.FindOrLoadComponent("FactoryServer","SPADDERPluginTester")
39 z=c.demo(2.,3.)
40
41 # Test of usage of KERNEL services from the test component
42 print "Test of usage of KERNEL services from the test component"
43 c.testkernel()
44
45 # Test of usage of SMESH engine from the test component
46 # WARN: the SMESH engine must be loaded first
47 print "Test of usage of SMESH engine from the test component"
48 import SMESH
49 salome.lcc.FindOrLoadComponent("FactoryServer","SMESH")
50 c.testsmesh(salome.myStudyId)
51
52 print "Test completed : OK"