Esempio n. 1
0
    def runTest(self):
        l = loc()

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

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

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

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

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

        ultramini.convertFunction(req, some_function)
Esempio n. 4
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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 7
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)
Esempio n. 8
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)
Esempio n. 9
0
    def runTest(self):
        l = loc("foo=bar")

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

        ultramini.convertFunction(l, another)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 22
0
    def runTest(self):
        req = loc()

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

        ultramini.convertFunction(req, some_function)
Esempio n. 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)
Esempio n. 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)
Esempio n. 25
0
    def runTest(self):
        @ultramini.arguments(ultramini.SITE)
        def some_function(foo):
            assert foo == PASSED

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

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

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

        ultramini.convertFunction(loc(), another)
Esempio n. 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)
Esempio n. 30
0
    def runTest(self):
        @ultramini.arguments(ultramini.RESOURCE)
        def some_function(foo):
            assert foo == PASSED

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

        ultramini.convertFunction(loc(method="GLORP"), some_function)
Esempio n. 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)
Esempio n. 33
0
    def runTest(self):
        @ultramini.arguments(ultramini.RESOURCE)
        def some_function(foo):
            assert foo == PASSED

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

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

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

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