import unittest from zope.component.testing import PlacelessSetup class Base(PlacelessSetup): def setUp(self): PlacelessSetup.setUp(self) def tearDown(self): PlacelessSetup.tearDown(self) def _zcmlConfigure(self): import repoze.bfg import zope.configuration.xmlconfig zope.configuration.xmlconfig.file('configure.zcml', package=repoze.bfg) def _getTemplatePath(self, name): import os here = os.path.abspath(os.path.dirname(__file__)) return os.path.join(here, 'fixtures', name) class ViewFactoryTests(unittest.TestCase): def _getTargetClass(self): from repoze.bfg.view import ViewFactory return ViewFactory def _makeOne(self, *arg, **kw): klass = self._getTargetClass() return klass(*arg, **kw) def test_call(self): view = self._makeOne(None, None) self.assertRaises(NotImplementedError, view)