示例#1
0
 def setUp(self):
     """
     Create an instance each time for testing.
     """
     self.instance = Router({
         '/': IndexHandler(),
         '': IndexHandler(),
         '/test/location[s]?$': IndexHandler(),
     })
示例#2
0
class TestIndexHandler(TestCase):

    def setUp(self):
        """
        Create an instance each time for testing.
        """
        self.instance = IndexHandler()

    def test_call(self):
        """
        Verify running IndexHandler returns proper information.
        """
        environ = {}
        buffer = {}

        def start_response(code, headers):
            buffer['code'] = code
            buffer['headers'] = headers

        result = self.instance.__call__(environ, start_response)
        assert buffer['code'] == '200 OK'
        assert buffer['headers'] == [("Content-Type", "text/html")]
        assert type(result) == str
示例#3
0
 def setUp(self):
     """
     Create an instance each time for testing.
     """
     self.instance = IndexHandler()
示例#4
0
 def setUp(self):
     """
     Create an instance each time for testing.
     """
     self.instance = Router({'/': IndexHandler()})