#NEWLINE# def test_listen( self ) : #NEWLINE# #INDENT# chmock = Mock ( spec = ListenChannel ) #NEWLINE# chmock . accept . side_effect = ChannelClosedError #NEWLINE# nodemock = Mock ( spec = NodeB ) #NEWLINE# nodemock . channel . return_value = chmock #NEWLINE# ep = ListeningBaseEndpoint ( node = nodemock , from_name = NameTrio ( sentinel . ex , sentinel . queue ) ) #NEWLINE# ep . listen ( ) #NEWLINE# chmock . setup_listener . assert_called_once_with ( ep . _recv_name , binding = sentinel . queue )