def runTest(self):
        l = loc()

        @ultramini.arguments(ultramini.LOCATION)
        def some_function(foo):
            assert foo == l

        ultramini.convertFunction(l, some_function)
Exemple #2
0
    def runTest(self):
        l = loc()

        @ultramini.arguments(ultramini.LOCATION)
        def some_function(foo):
            assert foo == l

        ultramini.convertFunction(l, some_function)
Exemple #3
0
    def runTest(self):
        req = loc()

        @ultramini.arguments(ultramini.REQUEST)
        def some_function(foo):
            assert foo == req

        ultramini.convertFunction(req, some_function)
    def runTest(self):
        l = loc(headers=dict(foo='bar'))

        @ultramini.arguments(ultramini.HEADER.foo)
        def some_function(foo):
            assert foo == 'bar'

        ultramini.convertFunction(l, some_function)
Exemple #5
0
    def runTest(self):
        l = loc("foo=bar")

        @ultramini.arguments(ultramini.QUERY("bar", DEFAULT))
        def another(bar):
            assert bar == DEFAULT

        ultramini.convertFunction(l, another)
Exemple #6
0
    def runTest(self):
        l = loc("foo=bar")

        @ultramini.arguments(ultramini.QUERY.foo)
        def some_function(foo):
            assert foo == "bar"

        ultramini.convertFunction(l, some_function)
    def runTest(self):
        l = loc(query="channel=462280&ver=3&p=run")

        @ultramini.arguments(ultramini.QUERY.channel)
        def some_function(channel):
            assert channel == "462280"

        ultramini.convertFunction(l, some_function)
    def runTest(self):
        l = loc(headers=dict(Cookie="foo=bar"))

        @ultramini.arguments(ultramini.COOKIE('bar', DEFAULT))
        def another(foo):
            assert foo == DEFAULT

        ultramini.convertFunction(l, another)
    def runTest(self):
        l = loc("foo=bar")

        @ultramini.arguments(ultramini.QUERY('bar', DEFAULT))
        def another(bar):
            assert bar == DEFAULT

        ultramini.convertFunction(l, another)
Exemple #10
0
    def runTest(self):
        l = loc("foo=bar&foo=baz")

        @ultramini.arguments(ultramini.QUERIES('bar', DEFAULT))
        def another(foo):
            assert foo == DEFAULT

        ultramini.convertFunction(l, another)
Exemple #11
0
    def runTest(self):
        l = loc("foo=bar&foo=baz")

        @ultramini.arguments(ultramini.QUERIES("bar", DEFAULT))
        def another(foo):
            assert foo == DEFAULT

        ultramini.convertFunction(l, another)
Exemple #12
0
    def runTest(self):
        l = loc(body='foo=bar&foo=baz', method='post')

        @ultramini.arguments(ultramini.ARGS('bar', DEFAULT))
        def another(foo):
            assert foo == DEFAULT

        ultramini.convertFunction(l, another)
Exemple #13
0
    def runTest(self):
        l = loc(body='foo=bar&foo=baz', method='post')

        @ultramini.arguments(ultramini.ARGS.foo)
        def some_function(foo):
            assert foo == ['bar', 'baz']

        ultramini.convertFunction(l, some_function)
Exemple #14
0
    def runTest(self):
        l = loc(headers=dict(foo="bar"))

        @ultramini.arguments(ultramini.HEADER.foo)
        def some_function(foo):
            assert foo == "bar"

        ultramini.convertFunction(l, some_function)
Exemple #15
0
    def runTest(self):
        l = loc(query="channel=462280&ver=3&p=run")

        @ultramini.arguments(ultramini.QUERY.channel)
        def some_function(channel):
            assert channel == "462280"

        ultramini.convertFunction(l, some_function)
Exemple #16
0
    def runTest(self):
        l = loc(headers=dict(Cookie="foo=bar"))

        @ultramini.arguments(ultramini.COOKIE("bar", DEFAULT))
        def another(foo):
            assert foo == DEFAULT

        ultramini.convertFunction(l, another)
Exemple #17
0
    def runTest(self):
        l = loc(headers=dict(Cookie="foo=bar"))

        @ultramini.arguments(ultramini.COOKIE.foo)
        def some_function(foo):
            assert foo == "bar"

        ultramini.convertFunction(l, some_function)
Exemple #18
0
    def runTest(self):
        l = loc(headers=dict(Cookie="foo=bar"))

        @ultramini.arguments(ultramini.COOKIE.foo)
        def some_function(foo):
            assert foo == "bar"

        ultramini.convertFunction(l, some_function)
Exemple #19
0
    def runTest(self):
        l = loc(body="foo=bar&foo=baz", method="post")

        @ultramini.arguments(ultramini.ARGS("bar", DEFAULT))
        def another(foo):
            assert foo == DEFAULT

        ultramini.convertFunction(l, another)
Exemple #20
0
    def runTest(self):
        l = loc(body="foo=bar&foo=baz", method="post")

        @ultramini.arguments(ultramini.ARGS.foo)
        def some_function(foo):
            assert foo == ["bar", "baz"]

        ultramini.convertFunction(l, some_function)
Exemple #21
0
    def runTest(self):
        l = loc("foo=bar")

        @ultramini.arguments(ultramini.QUERY.foo)
        def some_function(foo):
            assert foo == 'bar'

        ultramini.convertFunction(l, some_function)
Exemple #22
0
    def runTest(self):
        req = loc()

        @ultramini.arguments(ultramini.REQUEST)
        def some_function(foo):
            assert foo == req

        ultramini.convertFunction(req, some_function)
Exemple #23
0
    def runTest(self):
        l = loc("foo=bar&foo=baz")

        @ultramini.arguments(ultramini.QUERIES.foo)
        def some_function(foo):
            foo = tuple(foo)
            assert foo == ("bar", "baz")

        ultramini.convertFunction(l, some_function)
Exemple #24
0
    def runTest(self):
        l = loc("foo=bar&foo=baz")

        @ultramini.arguments(ultramini.QUERIES.foo)
        def some_function(foo):
            foo = tuple(foo)
            assert foo == ('bar', 'baz')

        ultramini.convertFunction(l, some_function)
Exemple #25
0
    def runTest(self):
        @ultramini.arguments(ultramini.SITE)
        def some_function(foo):
            assert foo == PASSED

        ultramini.convertFunction(loc(site=PASSED), some_function)
Exemple #26
0
    def runTest(self):
        @ultramini.arguments(ultramini.COOKIE("missing", DEFAULT))
        def another(foo):
            assert foo == DEFAULT

        ultramini.convertFunction(loc(), another)
Exemple #27
0
    def runTest(self):
        @ultramini.arguments(1234)
        def some_function(channel):
            assert channel == 1234

        ultramini.convertFunction(loc(), some_function)
Exemple #28
0
    def runTest(self):
        @ultramini.arguments(ultramini.COOKIE('missing', DEFAULT))
        def another(foo):
            assert foo == DEFAULT

        ultramini.convertFunction(loc(), another)
Exemple #29
0
    def runTest(self):
        @ultramini.arguments(ultramini.URI)
        def some_function(foo):
            assert foo == "/foo.gif"

        ultramini.convertFunction(loc(uri="/foo.gif"), some_function)
Exemple #30
0
    def runTest(self):
        @ultramini.arguments(ultramini.RESOURCE)
        def some_function(foo):
            assert foo == PASSED

        ultramini.convertFunction(loc(resource=PASSED), some_function)
Exemple #31
0
    def runTest(self):
        @ultramini.arguments(ultramini.METHOD)
        def some_function(foo):
            assert foo == "GLORP"

        ultramini.convertFunction(loc(method="GLORP"), some_function)
Exemple #32
0
    def runTest(self):
        @ultramini.arguments(ultramini.URI)
        def some_function(foo):
            assert foo == "/foo.gif"

        ultramini.convertFunction(loc(uri="/foo.gif"), some_function)
Exemple #33
0
    def runTest(self):
        @ultramini.arguments(ultramini.RESOURCE)
        def some_function(foo):
            assert foo == PASSED

        ultramini.convertFunction(loc(resource=PASSED), some_function)
Exemple #34
0
    def runTest(self):
        @ultramini.arguments(ultramini.METHOD)
        def some_function(foo):
            assert foo == "GLORP"

        ultramini.convertFunction(loc(method="GLORP"), some_function)
Exemple #35
0
    def runTest(self):
        @ultramini.arguments(1234)
        def some_function(channel):
            assert channel == 1234

        ultramini.convertFunction(loc(), some_function)
Exemple #36
0
    def runTest(self):
        @ultramini.arguments(ultramini.SITE)
        def some_function(foo):
            assert foo == PASSED

        ultramini.convertFunction(loc(site=PASSED), some_function)