#NEWLINE# @ istest #NEWLINE# def fails_to_install_package_if_it_doesnt_exist( self ) : #NEWLINE# #INDENT# with self . execute_mock ( ) , self . mock_role_methods ( 'package_exists' , 'is_package_installed' ) as ( package_exists , is_package_installed ) : #NEWLINE# #INDENT# is_package_installed . return_value = False #NEWLINE# package_exists . return_value = False #NEWLINE# self . assertRaises ( PackageNotFound , self . role . ensure_package_installed , 'phyton' ) #NEWLINE# self . assertTrue ( package_exists . called )