#NEWLINE# def test_compression_tween_factory( ) : #NEWLINE# #INDENT# callbacks = [ ] #NEWLINE# registry = pretend . stub ( ) #NEWLINE# request = pretend . stub ( add_response_callback = callbacks . append ) #NEWLINE# response = pretend . stub ( ) #NEWLINE# def handler( inner_request ) : #NEWLINE# #INDENT# assert ( inner_request is request ) #NEWLINE# return response #NEWLINE# #UNINDENT# tween = compression_tween_factory ( handler , registry ) #NEWLINE# assert ( tween ( tween ) is response ) #NEWLINE# assert ( callbacks == [ compressor ] )