#NEWLINE# def test_getMultiAdapter_hit( self ) : #NEWLINE# #INDENT# from zope.interface.declarations import InterfaceClass #NEWLINE# from zope.interface.declarations import implementer #NEWLINE# class IFoo ( InterfaceClass ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# ifoo = IFoo ( 'IFoo' ) #NEWLINE# ibar = IFoo ( 'IBar' ) #NEWLINE# ibaz = IFoo ( 'IBaz' ) #NEWLINE# @ implementer ( ibar ) #NEWLINE# class _Context1 ( object ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# @ implementer ( ibaz ) #NEWLINE# class _Context2 ( object ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# _context1 = _Context1 ( ) #NEWLINE# _context2 = _Context2 ( ) #NEWLINE# class _Factory ( object ) : #NEWLINE# #INDENT# def __init__( self , context1 , context2 ) : #NEWLINE# #INDENT# self . context = ( context1 , context2 ) #NEWLINE# #UNINDENT# #UNINDENT# comp = self . _makeOne ( ) #NEWLINE# comp . registerAdapter ( _Factory , ( ibar , ifoo ) , ifoo ) #NEWLINE# adapter = comp . getMultiAdapter ( ( _context1 , _context2 ) , ifoo ) #NEWLINE# self . failUnless ( isinstance ( adapter , _Factory ) ) #NEWLINE# self . assertEqual ( adapter . context , ( _context1 , _context2 ) )