#NEWLINE# @ mock . patch . object ( host . Host , '_get_domain_by_name' ) #NEWLINE# def test_get_domain( self , fake_get_domain ) : #NEWLINE# #INDENT# dom = fakelibvirt . virDomain ( self . host . get_connection ( ) , "<domain id='7'/>" ) #NEWLINE# fake_get_domain . return_value = dom #NEWLINE# instance = objects . Instance ( id = '124' ) #NEWLINE# self . assertEqual ( dom , self . host . get_domain ( instance ) ) #NEWLINE# fake_get_domain . assert_called_once_with ( 'instance-0000007c' )