Exemple #1
0
def test_named_directives():
    """Ensure that it's possible to attach directives to named parameters"""
    @hug.get()
    def test(time: hug.directives.Timer=3):
        return time

    assert isinstance(test(1), int)

    test = hug.local()(test)
    assert isinstance(test(), hug.directives.Timer)
Exemple #2
0
def test_named_directives():
    """Ensure that it's possible to attach directives to named parameters"""
    @hug.get()
    def test(time: hug.directives.Timer = 3):
        return time

    assert isinstance(test(1), int)

    test = hug.local()(test)
    assert isinstance(test(), hug.directives.Timer)