#NEWLINE# def _multicast_side_effect_helper( self , side_effect ) : #NEWLINE# #INDENT# arbiter = mock . MagicMock ( ) #NEWLINE# loop = mock . MagicMock ( ) #NEWLINE# context = mock . sentinel . context #NEWLINE# controller = circus . controller . Controller ( 'endpoint' , DEFAULT_ENDPOINT_MULTICAST , context , loop , arbiter ) #NEWLINE# with mock . patch ( 'circus.util.create_udp_socket' ) as m : #NEWLINE# #INDENT# m . side_effect = side_effect #NEWLINE# circus . controller . create_udp_socket = side_effect #NEWLINE# with mock . patch . object ( logger , 'warning' ) as mock_logger_warn : #NEWLINE# #INDENT# controller . _init_multicast_endpoint ( ) #NEWLINE# self . assertTrue ( mock_logger_warn . called )