From: spo Date: Thu, 22 Oct 2015 08:15:02 +0000 (+0300) Subject: Make redirect missing attributes to the feature. X-Git-Tag: V_2.1.0~206^2~79^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4560b56d9cef2d18bee2e93c4a0b66d6b711bf87;p=modules%2Fshaper.git Make redirect missing attributes to the feature. --- diff --git a/src/PythonAPI/Test/TestFeaturesExtrusion.py b/src/PythonAPI/Test/TestFeaturesExtrusion.py index 1d506590b..7d08ee901 100644 --- a/src/PythonAPI/Test/TestFeaturesExtrusion.py +++ b/src/PythonAPI/Test/TestFeaturesExtrusion.py @@ -79,6 +79,10 @@ class FeaturesAddExtrusionTestCase(FeaturesAddExtrusionFixture): class FeaturesExtrusionTestCase(FeaturesExtrusionFixture): + def test_extrusion_feature_calls(self): + # call method of the feature + self.assertEqual(self.extrusion.getKind(), "Extrusion") + def test_extrusion_set_sizes(self): self.extrusion.setSize(15, 20) diff --git a/src/PythonAPI/model/roots.py b/src/PythonAPI/model/roots.py index 117840e47..dd239d342 100644 --- a/src/PythonAPI/model/roots.py +++ b/src/PythonAPI/model/roots.py @@ -33,7 +33,12 @@ class Interface(): def __init__(self, feature): self._feature = feature + def __getattr__(self, name): + """Process missing attributes. + Redirect missing attributes to the feature. + """ + return self._feature.__getattribute__(name) def setRealInput (self, inputid, value): self._feature.data().real(inputid).setValue(value)