#NEWLINE# @ istest #NEWLINE# def installs_necessary_packages_to_provision( self ) : #NEWLINE# #INDENT# with self . using_stub ( AptitudeRole ) as mock_aptitude , self . execute_mock ( ) as execute : #NEWLINE# #INDENT# mock_aptitude . ensure_package_installed . return_value = 'some result' #NEWLINE# self . role . provision ( ) #NEWLINE# self . assertEqual ( execute . mock_calls , [ call ( 'echo "mysql-server mysql-server/root_password select temppass" | debconf-set-selections' , stdout = False , sudo = True ) , call ( 'echo "mysql-server mysql-server/root_password_again select temppass" | debconf-set-selections' , stdout = False , sudo = True ) , call ( ( "mysqladmin -u %s -p'temppass' password '%s'" % ( self . role . mysql_root_user , self . role . mysql_root_pass ) ) , stdout = False , sudo = True ) ] ) #NEWLINE# self . assertEqual ( self . ensure_package_installed . mock_calls , [ call ( 'mysql-server' ) , call ( 'mysql-client' ) , call ( 'libmysqlclient-dev' ) ] )