From 4560b56d9cef2d18bee2e93c4a0b66d6b711bf87 Mon Sep 17 00:00:00 2001 From: spo Date: Thu, 22 Oct 2015 11:15:02 +0300 Subject: [PATCH] Make redirect missing attributes to the feature. --- src/PythonAPI/Test/TestFeaturesExtrusion.py | 4 ++++ src/PythonAPI/model/roots.py | 5 +++++ 2 files changed, 9 insertions(+) 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) -- 2.39.2