Source

PylonsWikiNG / src / layout / tutorial / tests.py

import unittest

from pylons.configuration import Configurator

class WikiHandlerTests(unittest.TestCase):
    def setUp(self):
        self.config = Configurator()
        self.config.begin()

    def tearDown(self):
        self.config.end()

    def _makeOne(self, request):
        from tutorial.handlers import WikiHandler
        return WikiHandler(request)

    def test_index(self):
        request = DummyRequest()
        handler = self._makeOne(request)
        info = handler.index()
        self.assertEqual(info['project'], 'tutorial')

class DummyRequest(object):
    pass