#NEWLINE# def test_execute_command( self ) : #NEWLINE# #INDENT# with mock . patch ( 'subprocess.Popen' ) as popen : #NEWLINE# #INDENT# popen . return_value = mock . Mock ( ) #NEWLINE# popen . return_value . returncode = 0 #NEWLINE# popen . return_value . communicate . return_value = ( 'Output\nHere' , None ) #NEWLINE# output = self . check . execute_command ( [ 'some' , 'args' ] ) #NEWLINE# self . assertEquals ( [ 'Output' , 'Here' ] , list ( output ) ) #NEWLINE# args = list ( popen . call_args ) #NEWLINE# self . assertTrue ( ( [ 'some' , 'args' ] in args [ 0 ] ) )