#NEWLINE# def run_srb( self , * argv ) : #NEWLINE# #INDENT# mock_stdout = six . StringIO ( ) #NEWLINE# mock_stderr = six . StringIO ( ) #NEWLINE# srb_args = ( [ '' , self . tempfile ] + [ str ( s ) for s in argv ] ) #NEWLINE# try : #NEWLINE# #INDENT# with mock . patch ( 'sys.stdout' , mock_stdout ) : #NEWLINE# #INDENT# with mock . patch ( 'sys.stderr' , mock_stderr ) : #NEWLINE# #INDENT# ringbuilder . main ( srb_args ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except SystemExit as err : #NEWLINE# #INDENT# if ( err . code not in ( 0 , 1 ) ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# #UNINDENT# return ( mock_stdout . getvalue ( ) , mock_stderr . getvalue ( ) )