test_configure_component.py 文件源码

python
阅读 15 收藏 0 点赞 0 评论 0

项目:guillotina 作者: plone 项目源码 文件源码
def test_no_name(self):
        from zope.interface import Interface

        class IFoo(Interface):
            pass

        class IBar(Interface):
            pass

        from guillotina.component import adapter
        from zope.interface import implementer, named

        @adapter(IFoo)
        @implementer(IBar)
        @named('bar')
        class _Factory(object):
            def __init__(self, context):
                self.context = context
        _cfg_ctx = _makeConfigContext()
        self._callFUT(_cfg_ctx, [_Factory])
        # Register the adapter
        action = _cfg_ctx._actions[0][1]
        self.assertEqual(action['args'][4], 'bar')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号