summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests/test_wsgi.py
blob: e19e65044c01af0ca540b279939b756ae6241736 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import unittest
from zope.testing.cleanup import cleanUp

class WSGIAppTests(unittest.TestCase):
    def setUp(self):
        cleanUp()

    def tearDown(self):
        cleanUp()
        
    def test_decorator(self):
        from repoze.bfg.wsgi import wsgiapp
        wrapped = wsgiapp(dummyapp)
        context = DummyContext()
        request = DummyRequest()
        response = wrapped(context, request)
        self.assertEqual(response, dummyapp)

def dummyapp(environ, start_response):
    """ """

class DummyContext:
    pass

class DummyRequest:
    def get_response(self, application):
        return application