#NEWLINE# def test_owner( self ) : #NEWLINE# #INDENT# '\n        Test if it return the name of the package that owns the file.\n        ' #NEWLINE# self . assertEqual ( rpm . owner ( ) , '' ) #NEWLINE# ret = 'file /usr/bin/salt-jenkins-build is not owned by any package' #NEWLINE# mock = MagicMock ( return_value = ret ) #NEWLINE# with patch . dict ( rpm . __salt__ , { #NEWLINE# #INDENT# 'cmd.run_stdout' : mock , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# self . assertEqual ( rpm . owner ( '/usr/bin/salt-jenkins-build' ) , '' ) #NEWLINE# #UNINDENT# ret = { #NEWLINE# #INDENT# '/usr/bin/vim' : 'vim-enhanced-7.4.160-1.e17.x86_64' , #NEWLINE# '/usr/bin/python' : 'python-2.7.5-16.e17.x86_64' , #NEWLINE# #UNINDENT# } #NEWLINE# mock = MagicMock ( side_effect = [ 'python-2.7.5-16.e17.x86_64' , 'vim-enhanced-7.4.160-1.e17.x86_64' ] ) #NEWLINE# with patch . dict ( rpm . __salt__ , { #NEWLINE# #INDENT# 'cmd.run_stdout' : mock , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# self . assertDictEqual ( rpm . owner ( '/usr/bin/python' , '/usr/bin/vim' ) , ret )