#NEWLINE# def generate_output( self , expected ) : #NEWLINE# #INDENT# if isinstance ( expected , list ) : #NEWLINE# #INDENT# expected_out = '' #NEWLINE# for exp in expected : #NEWLINE# #INDENT# expected_out += self . generate_output ( exp ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# count = expected . count ( '\n' ) #NEWLINE# expected_out = '\r' #NEWLINE# if count : #NEWLINE# #INDENT# expected_out += ( '\x1b[%dA' % count ) #NEWLINE# #UNINDENT# expected_out += expected #NEWLINE# #UNINDENT# return decode ( expected_out )