#NEWLINE# def test_uninstall( self ) : #NEWLINE# #INDENT# process = MagicMock ( ) #NEWLINE# process . communicate . side_effect = [ ( '' , '' ) , ( '' , '' ) ] #NEWLINE# process . returncode = 0 #NEWLINE# self . popen . return_value = process #NEWLINE# self . windows . uninstall ( process . params ) #NEWLINE# self . popen . assert_has_calls ( [ call ( [ 'powershell.exe' , '-Command' , 'Stop-Service' , '-Name' , 'codedeployagent' ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) , call ( ) . communicate ( ) , call ( [ 'wmic' , 'product' , 'where' , 'name="CodeDeploy Host Agent"' , 'call' , 'uninstall' , '/nointeractive' ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) , call ( ) . communicate ( ) ] )