#NEWLINE# def test_proxy_connection_error( container_factory , rabbit_config ) : #NEWLINE# #INDENT# container = container_factory ( FooService , rabbit_config ) #NEWLINE# container . start ( ) #NEWLINE# with ServiceRpcProxy ( 'foobar' , rabbit_config ) as proxy : #NEWLINE# #INDENT# queue_consumer = get . reply_listener . queue_consumer #NEWLINE# with patch . object ( queue_consumer , 'get_message' , autospec = True ) as get : #NEWLINE# #INDENT# get . side_effect = socket . error #NEWLINE# with pytest . raises ( socket . error ) : #NEWLINE# #INDENT# proxy . spam ( '' )