From a329e6de49c77eb55d2eff09b27ab71d497065c5 Mon Sep 17 00:00:00 2001 From: spo Date: Wed, 22 Jul 2015 16:23:37 +0300 Subject: [PATCH] Issue #761 - Check and error for unique parameter name -- Fix tests --- src/ParametersPlugin/Test/TestParameterChangeValue.py | 4 ++-- src/ParametersPlugin/Test/TestParameterRename.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ParametersPlugin/Test/TestParameterChangeValue.py b/src/ParametersPlugin/Test/TestParameterChangeValue.py index cfc99c262..4e810d765 100644 --- a/src/ParametersPlugin/Test/TestParameterChangeValue.py +++ b/src/ParametersPlugin/Test/TestParameterChangeValue.py @@ -51,15 +51,15 @@ class TestParameterRename(unittest.TestCase): ltNames = ["x1", "y1", "x2"] ltExpressions = ["150.", "200.", "x1 + y1 + 100.0"] self.dtParams = {} - self.aSession.startOperation() for name, expr in zip(ltNames, ltExpressions): + self.aSession.startOperation() aParam = self.aDocument.addFeature("Parameter") aParamName = aParam.string("variable") aParamName.setValue(name) aParamExpr = aParam.string("expression") aParamExpr.setValue(expr) self.dtParams[name] = aParam - self.aSession.finishOperation() + self.aSession.finishOperation() self.assertEqual(len(self.dtParams), len(ltNames)) aParam = self.dtParams["x2"] diff --git a/src/ParametersPlugin/Test/TestParameterRename.py b/src/ParametersPlugin/Test/TestParameterRename.py index ef8bd2e6b..552142630 100644 --- a/src/ParametersPlugin/Test/TestParameterRename.py +++ b/src/ParametersPlugin/Test/TestParameterRename.py @@ -53,15 +53,15 @@ class TestParameterRename(unittest.TestCase): ltNames = ["x1", "y1", "x2"] ltExpressions = ["150.", "200.", "x1 + y1 + 100.0"] self.dtParams = {} - self.aSession.startOperation() for name, expr in zip(ltNames, ltExpressions): + self.aSession.startOperation() aParam = self.aDocument.addFeature("Parameter") aParamName = aParam.string("variable") aParamName.setValue(name) aParamExpr = aParam.string("expression") aParamExpr.setValue(expr) self.dtParams[name] = aParam - self.aSession.finishOperation() + self.aSession.finishOperation() self.assertEqual(len(self.dtParams), len(ltNames)) aParam = self.dtParams["x2"] -- 2.39.2