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')
评论列表
文章目录