diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-03-28 14:30:49 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-03-28 14:30:49 +0800 |
commit | 2e08872902f752addff5c6755d698b4fbb022a7c (patch) | |
tree | 62b3c05ac35b7df9a8dcd932e76493cde14a80e0 /testapi/opnfv_testapi/resources | |
parent | 3bda241da0264a6a46cbda51f61931dd4299db20 (diff) |
keep methods' name/docstring after decorator
applying functools.wraps() to keep the name and docstring
of the original function which is decorated
Change-Id: Id612039921566dd48f8d8797abe30f23aaf99301
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/opnfv_testapi/resources')
-rw-r--r-- | testapi/opnfv_testapi/resources/scenario_handlers.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/testapi/opnfv_testapi/resources/scenario_handlers.py b/testapi/opnfv_testapi/resources/scenario_handlers.py index 083bf59..4c31a6f 100644 --- a/testapi/opnfv_testapi/resources/scenario_handlers.py +++ b/testapi/opnfv_testapi/resources/scenario_handlers.py @@ -1,3 +1,5 @@ +import functools + from opnfv_testapi.common import constants from opnfv_testapi.resources import handlers import opnfv_testapi.resources.scenario_models as models @@ -158,18 +160,21 @@ class ScenarioGURHandler(GenericScenarioHandler): return data.format() def _iter_installers(xstep): + @functools.wraps(xstep) def magic(self, data): [xstep(self, installer) for installer in self._filter_installers(data.installers)] return magic def _iter_versions(xstep): + @functools.wraps(xstep) def magic(self, installer): [xstep(self, version) for version in (self._filter_versions(installer.versions))] return magic def _iter_projects(xstep): + @functools.wraps(xstep) def magic(self, version): [xstep(self, project) for project in (self._filter_projects(version.projects))] |