def direct(fn): """ The *direct* decorator used to specify the *direct* model. :param fn: The function being decorated. :type fn: function :return: The decorated function. """ opt = options(fn) opt.call.model = valid_model(DIRECT) return fn
def inner(fn): opt = options(fn) opt.call.model = valid_model(model) if secret: required = Options() required.secret = secret auth = ('secret', required) opt.security.append(auth) Remote.add(fn) return fn
def fork(fn): """ The *fork* decorator used to specify the *fork* model. :param fn: The function being decorated. :type fn: function :return: The decorated function. """ opt = options(fn) opt.call.model = valid_model(FORK) return fn
def test_valid_model(self): # valid for model in ALL: self.assertTrue(valid_model(model)) # invalid self.assertRaises(ValueError, valid_model, 1234)
def inner(fn): opt = options(fn) opt.call.model = valid_model(model) Remote.add(fn) return fn