#NEWLINE# def test_uninstall( self ) : #NEWLINE# #INDENT# process = MagicMock ( ) #NEWLINE# process . communicate . return_value = ( '' , '' ) #NEWLINE# process . returncode = 0 #NEWLINE# self . popen . return_value = process #NEWLINE# self . ubuntu . uninstall ( self . params ) #NEWLINE# self . popen . assert_has_calls ( [ call ( [ 'service' , 'codedeploy-agent' , 'stop' ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) , call ( ) . communicate ( ) ] ) #NEWLINE# self . check_call . assert_has_calls ( [ call ( [ 'dpkg' , '-r' , 'codedeploy-agent' ] ) ] )