#NEWLINE# @ mock . patch . object ( fakelibvirt . virConnect , 'registerCloseCallback' ) #NEWLINE# def test_close_callback_not_defined( self , mock_close ) : #NEWLINE# #INDENT# 'Validates that a connection to libvirt exist,\n           even when registerCloseCallback method missing from\n           the libvirt python library.\n        ' #NEWLINE# mock_close . side_effect = AttributeError ( 'dd' ) #NEWLINE# connection = self . host . get_connection ( ) #NEWLINE# self . assertTrue ( connection )