#NEWLINE# def test_lv_absent( self ) : #NEWLINE# #INDENT# '\n        Test to remove a given existing logical volume\n        from a named existing volume group\n        ' #NEWLINE# name = '/dev/sda5' #NEWLINE# comt = 'Logical Volume {0} already absent' . format ( name ) #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'result' : True , #NEWLINE# 'comment' : comt , #NEWLINE# #UNINDENT# } #NEWLINE# mock = MagicMock ( side_effect = [ False , True ] ) #NEWLINE# with patch . dict ( lvm . __salt__ , { #NEWLINE# #INDENT# 'lvm.lvdisplay' : mock , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# self . assertDictEqual ( lvm . lv_absent ( name ) , ret ) #NEWLINE# comt = 'Logical Volume {0} is set to be removed' . format ( name ) #NEWLINE# ret . update ( { #NEWLINE# #INDENT# 'comment' : self , #NEWLINE# 'result' : None , #NEWLINE# #UNINDENT# } ) #NEWLINE# with patch . dict ( lvm . __opts__ , { #NEWLINE# #INDENT# 'test' : True , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# self . assertDictEqual ( lvm . lv_absent ( name ) , ret )