def __build_methods(self, method_subsection): """Add a bound method to this object for each method defined in the specified method_subsection of METHODS. """ for method_name in METHODS.get(method_subsection, {}): config = METHODS.get(method_subsection, {}).get(method_name) method = build_method(**config) self.__setattr__(method_name, types.MethodType(method, self, API))
def test_method_creation(self): for app_type in METHODS: for method in METHODS.get(app_type): self.assertTrue(hasattr(getattr(self.api, method), '__call__'))