#NEWLINE# def test_run_command_unicode_bytes( self ) : #NEWLINE# #INDENT# backup_Popen = catkin . builder . subprocess . Popen #NEWLINE# class StdOut ( object ) : #NEWLINE# #INDENT# def __init__( self , popen ) : #NEWLINE# #INDENT# self . __popen = popen #NEWLINE# #UNINDENT# def readline( self ) : #NEWLINE# #INDENT# self . __popen . returncode = 0 #NEWLINE# try : #NEWLINE# #INDENT# s = unichr ( 2018 ) #NEWLINE# #UNINDENT# except NameError : #NEWLINE# #INDENT# s = chr ( 2018 ) #NEWLINE# #UNINDENT# return s . encode ( 'utf8' ) #NEWLINE# #UNINDENT# #UNINDENT# class MockPopen ( object ) : #NEWLINE# #INDENT# def __init__( self , * args , **kwargs ) : #NEWLINE# #INDENT# self . returncode = None #NEWLINE# self . stdout = StdOut ( self ) #NEWLINE# #UNINDENT# def wait( self ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# catkin . builder . subprocess . Popen = MockPopen #NEWLINE# catkin . builder . run_command ( [ 'false' ] , os . getcwd ( ) , True , True ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# catkin . builder . subprocess . Popen = self