<s> from io import BytesIO <EOL> from . . inputs . list_input import ListInput <EOL> from . . outputs . stream_output import StreamOutput <EOL> class ApplicationTester ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , application ) : <EOL> """<STR_LIT>""" <EOL> self . __application = application <EOL> self . __input = None <EOL> self . __output = None <EOL> def run ( self , input_ , options = None ) : <EOL> """<STR_LIT>""" <EOL> options = options or { } <EOL> self . __input = ListInput ( input_ ) <EOL> if '<STR_LIT>' in options : <EOL> self . __input . set_interactive ( options [ '<STR_LIT>' ] ) <EOL> self . __output = StreamOutput ( BytesIO ( ) ) <EOL> if '<STR_LIT>' in options : <EOL> self . __output . set_decorated ( options [ '<STR_LIT>' ] ) <EOL> if '<STR_LIT>' in options : <EOL> self . __output . set_verbosity ( options [ '<STR_LIT>' ] ) <EOL> self . __application . run ( self . __input , self . __output ) <EOL> def get_display ( self ) : <EOL> """<STR_LIT>""" <EOL> self . __output . get_stream ( ) . seek ( <NUM_LIT:0> ) <EOL> return self . __output . get_stream ( ) . read ( ) . decode ( '<STR_LIT:utf-8>' ) <EOL> def get_input ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __input <EOL> def get_output ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __output </s>
