예제 #1
0
    def runTest(self):
        l = loc()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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