#NEWLINE# def test_vg_present( self ) : #NEWLINE# #INDENT# '\n        Test to create an LVM volume group\n        ' #NEWLINE# name = '/dev/sda5' #NEWLINE# comt = 'Failed to create Volume Group {0}' . format ( name ) #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'result' : False , #NEWLINE# 'comment' : comt , #NEWLINE# #UNINDENT# } #NEWLINE# mock = MagicMock ( return_value = False ) #NEWLINE# with patch . dict ( lvm . __salt__ , { #NEWLINE# #INDENT# 'lvm.vgdisplay' : mock , #NEWLINE# 'lvm.vgcreate' : mock , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# with patch . dict ( lvm . __opts__ , { #NEWLINE# #INDENT# 'test' : False , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# self . assertDictEqual ( lvm . vg_present ( name ) , ret ) #NEWLINE# #UNINDENT# comt = 'Volume Group {0} is set to be created' . format ( name ) #NEWLINE# ret . update ( { #NEWLINE# #INDENT# 'comment' : comt , #NEWLINE# 'result' : None , #NEWLINE# #UNINDENT# } ) #NEWLINE# with patch . dict ( lvm . __opts__ , { #NEWLINE# #INDENT# 'test' : True , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# self . assertDictEqual ( lvm . vg_present ( name ) , ret )