#NEWLINE# def test_issue_6833_pip_upgrade_pip( self ) : #NEWLINE# #INDENT# venv_dir = os . path . join ( integration . TMP , '6833-pip-upgrade-pip' ) #NEWLINE# ret = self . run_function ( 'virtualenv.create' , [ venv_dir ] ) #NEWLINE# try : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . assertEqual ( ret [ 'retcode' ] , 0 ) #NEWLINE# self . assertIn ( 'New python executable' , ret [ 'stdout' ] ) #NEWLINE# #UNINDENT# except AssertionError : #NEWLINE# #INDENT# import pprint #NEWLINE# pprint . pprint ( ret ) #NEWLINE# raise #NEWLINE# #UNINDENT# ret = self . run_function ( 'pip.install' , [ 'pip==6.0' ] , upgrade = True , ignore_installed = True , bin_env = ret ) #NEWLINE# try : #NEWLINE# #INDENT# self . assertEqual ( ret [ 'retcode' ] , 0 ) #NEWLINE# self . assertIn ( 'Successfully installed pip' , ret [ 'stdout' ] ) #NEWLINE# #UNINDENT# except AssertionError : #NEWLINE# #INDENT# import pprint #NEWLINE# pprint . pprint ( ret ) #NEWLINE# raise #NEWLINE# #UNINDENT# self . assertEqual ( self . run_function ( 'pip.list' , [ 'pip' ] , bin_env = venv_dir ) , { #NEWLINE# #INDENT# 'pip' : '6.0' , #NEWLINE# #UNINDENT# } ) #NEWLINE# ret = self . run_state ( 'pip.installed' , name = 'pip==6.0.7' , upgrade = True , bin_env = venv_dir ) #NEWLINE# try : #NEWLINE# #INDENT# self . assertSaltTrueReturn ( ret ) #NEWLINE# self . assertInSaltReturn ( 'Installed' , ret , [ 'changes' , 'pip==6.0.7' ] ) #NEWLINE# #UNINDENT# except AssertionError : #NEWLINE# #INDENT# import pprint #NEWLINE# pprint . pprint ( ret ) #NEWLINE# raise #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# if os . path . isdir ( venv_dir ) : #NEWLINE# #INDENT# shutil . rmtree ( venv_dir )