Esempio n. 1
0
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
Esempio n. 2
0
 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
Esempio n. 3
0
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
Esempio n. 4
0
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
Esempio n. 5
0
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
Esempio n. 6
0
 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
Esempio n. 7
0
 def test_valid_model(self):
     # valid
     for model in ALL:
         self.assertTrue(valid_model(model))
     # invalid
     self.assertRaises(ValueError, valid_model, 1234)
Esempio n. 8
0
 def test_valid_model(self):
     # valid
     for model in ALL:
         self.assertTrue(valid_model(model))
     # invalid
     self.assertRaises(ValueError, valid_model, 1234)
Esempio n. 9
0
 def inner(fn):
     opt = options(fn)
     opt.call.model = valid_model(model)
     Remote.add(fn)
     return fn