From 91e2f5d985dd2a38fdb1782caed59f80d8cada31 Mon Sep 17 00:00:00 2001 From: spo Date: Mon, 20 Jun 2016 13:45:43 +0300 Subject: [PATCH] Fix tests --- src/PythonAPI/extension/box.py | 6 +++--- src/PythonAPI/model/roots.py | 25 ------------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/PythonAPI/extension/box.py b/src/PythonAPI/extension/box.py index c3ef9dcbc..9d4d66ce9 100644 --- a/src/PythonAPI/extension/box.py +++ b/src/PythonAPI/extension/box.py @@ -52,15 +52,15 @@ class Box(Interface): def setWidth(self, width): """B.setWidth(float) -- modify width attribute""" - self._fillAttribute(self._width, width) + self._width.setValue(width) pass def setLength(self, length): """B.setLength(float) -- modify length attribute""" - self._fillAttribute(self._length, length) + self._length.setValue(length) pass def setHeight(self, height): """B.setHeight(float) -- modify height attribute""" - self._fillAttribute(self._height, height) + self._height.setValue(height) pass diff --git a/src/PythonAPI/model/roots.py b/src/PythonAPI/model/roots.py index 2ba6a21de..77a2335ce 100644 --- a/src/PythonAPI/model/roots.py +++ b/src/PythonAPI/model/roots.py @@ -5,9 +5,6 @@ Copyright (C) 2014-20xx CEA/DEN, EDF R&D import ModelAPI -from model import tools - - class Feature(ModelAPI.ModelAPI_Feature): """Base class of user-defined Python features.""" @@ -43,28 +40,6 @@ class Interface(): """x.__init__(...) initializes x; see x.__class__.__doc__ for signature""" self._feature = feature - def __getattr__(self, name): - """Process missing attributes. - - Add get*() methods for access feature attributes. - """ - if name.startswith("get"): - possible_names = [ - "_" + name[3:], - "_" + tools.convert_to_underscore(name[3:]), - ] - for possible_name in possible_names: - if hasattr(self, possible_name): - def getter(): - return getattr(self, possible_name) - return getter - - raise AttributeError() - - def _fillAttribute(self, attribute, value): - """Fill ModelAPI_Attribute* with value.""" - tools.fill_attribute(attribute, value) - def feature(self): """Return ModelAPI_Feature.""" return self._feature -- 2.39.2