X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParametersPlugin%2FTest%2FTestParameterErrorMsg.py;fp=src%2FParametersPlugin%2FTest%2FTestParameterErrorMsg.py;h=1030c77cf4d6a55eaafc867f36fe14c733556aab;hb=08e661e0df1d1fb54ad8d59655cd9dee0340c922;hp=0000000000000000000000000000000000000000;hpb=2af8083535a7ecde34e07c572cbab5f807cdb045;p=modules%2Fshaper.git diff --git a/src/ParametersPlugin/Test/TestParameterErrorMsg.py b/src/ParametersPlugin/Test/TestParameterErrorMsg.py new file mode 100644 index 000000000..1030c77cf --- /dev/null +++ b/src/ParametersPlugin/Test/TestParameterErrorMsg.py @@ -0,0 +1,37 @@ +## Copyright (C) 2018-20xx CEA/DEN, 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, or (at your option) any later version. +## +## 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 +## + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +# check error on empty name +Param1 = model.addParameter(partSet, "", "100") +assert(Param1.feature().error() != "") +# check error on empty value +Param2 = model.addParameter(partSet, "L", "") +assert(Param2.feature().error() != "") +# check error if name is not variable +Param3 = model.addParameter(partSet, "100", "100") +assert(Param3.feature().error() != "") +# check error on wrong value expression +Param4 = model.addParameter(partSet, "N", "+-.so&@") +assert(Param4.feature().error() != "") +model.end()