Exemple #1
0
    def test_factory_as_object(self):
        config = self._makeOne()

        def _fakeAction(discriminator,
                        callable=None,
                        args=(),
                        kw=None,
                        order=0,
                        introspectables=(),
                        **extra):
            self.assertEqual(len(introspectables), 1)
            self.assertEqual(introspectables[0]['name'], 'testing')
            self.assertEqual(introspectables[0]['factory'], DummyPredicate)

        config.action = _fakeAction
        config._add_predicate('route', 'testing', DummyPredicate)
Exemple #2
0
    def test_factory_as_object(self):
        config = self._makeOne()

        def _fakeAction(
            discriminator,
            callable=None,
            args=(),
            kw=None,
            order=0,
            introspectables=(),
            **extra
        ):
            self.assertEqual(len(introspectables), 1)
            self.assertEqual(introspectables[0]['name'], 'testing')
            self.assertEqual(introspectables[0]['factory'], DummyPredicate)

        config.action = _fakeAction
        config._add_predicate('route', 'testing', DummyPredicate)