Salome HOME
Make redirect missing attributes to the feature.
authorspo <sergey.pokhodenko@opencascade.com>
Thu, 22 Oct 2015 08:15:02 +0000 (11:15 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Thu, 22 Oct 2015 08:15:02 +0000 (11:15 +0300)
src/PythonAPI/Test/TestFeaturesExtrusion.py
src/PythonAPI/model/roots.py

index 1d506590bad7a7016f4afdfa701f3d1b5f61b934..7d08ee9010cb68260755a312ed730d689c681879 100644 (file)
@@ -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)
 
index 117840e47253de6c38b6218a30f67dc48dad53ea..dd239d3428f38b92932fe73a70a3633439128003 100644 (file)
@@ -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)