def assert_has_next_page(self): """ :raise: exception.BunqException """ if self._next_id is None: raise exception.BunqException(self._ERROR_NO_NEXT_PAGE)
def assert_has_previous_page(self): """ :raise: exception.BunqException """ if not self.has_previous_page(): raise exception.BunqException(self._ERROR_NO_PREVIOUS_PAGE)
def _str_to_type_from_member_module(cls, module_, string): """ :type module_: module :type string: str :rtype: type :raise: BunqException when could not find the class for the string. """ module_name_short, class_name = string.split(cls._DELIMITER_MODULE) members = inspect.getmembers(module_, inspect.ismodule) for name, module_member in members: if module_name_short == name: return getattr(module_member, class_name) error_message = cls._ERROR_COULD_NOT_FIND_CLASS.format(string) raise exception.BunqException(error_message)