test_configure_component.py 文件源码

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

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

        class IFoo(Interface):
            pass

        @implementer(IFoo)
        @named('foo')
        class Foo(object):
            pass
        foo = Foo()
        _cfg_ctx = _makeConfigContext()
        self._callFUT(_cfg_ctx, component=foo)
        action = _cfg_ctx._actions[0][1]
        self.assertEqual(action['args'][1], foo)
        self.assertEqual(action['args'][2], IFoo)
        self.assertEqual(action['args'][3], 'foo')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号