#NEWLINE# def test_verify( self ) : #NEWLINE# #INDENT# iface1 = mock . MagicMock ( __name__ = 'iface1' ) #NEWLINE# iface2 = mock . MagicMock ( __name__ = 'iface2' ) #NEWLINE# iface3 = mock . MagicMock ( __name__ = 'iface3' ) #NEWLINE# self . plugin_ep . _initialized = plugin = mock . MagicMock ( ) #NEWLINE# exceptions = zope . interface . exceptions #NEWLINE# with mock . patch ( 'certbot.plugins.disco.zope.interface' ) as mock_zope : #NEWLINE# #INDENT# mock_zope . exceptions = exceptions #NEWLINE# def verify_object( iface , obj ) : #NEWLINE# #INDENT# assert ( obj is plugin ) #NEWLINE# assert ( ( iface is iface1 ) or ( iface is iface2 ) or ( iface is iface3 ) ) #NEWLINE# if ( iface is iface3 ) : #NEWLINE# #INDENT# raise mock_zope . exceptions . BrokenImplementation ( None , None ) #NEWLINE# #UNINDENT# #UNINDENT# mock_zope . verify . verifyObject . side_effect = verify_object #NEWLINE# self . assertTrue ( self . plugin_ep . verify ( ( iface1 , ) ) ) #NEWLINE# self . assertTrue ( self . plugin_ep . verify ( ( iface1 , iface2 ) ) ) #NEWLINE# self . assertFalse ( self . plugin_ep . verify ( ( iface3 , ) ) ) #NEWLINE# self . assertFalse ( self . plugin_ep . verify ( ( iface1 , iface3 ) ) )