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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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