#NEWLINE# @ mock . patch . object ( fakelibvirt . virDomain , 'jobInfo' ) #NEWLINE# @ mock . patch . object ( fakelibvirt . virDomain , 'jobStats' ) #NEWLINE# def test_job_info_no_support( self , mock_stats , mock_info ) : #NEWLINE# #INDENT# mock_stats . side_effect = fakelibvirt . make_libvirtError ( fakelibvirt . libvirtError , 'virDomainGetJobStats not implemented' , fakelibvirt . VIR_ERR_NO_SUPPORT ) #NEWLINE# mock_info . return_value = [ fakelibvirt . VIR_DOMAIN_JOB_UNBOUNDED , 100 , 99 , 10 , 11 , 12 , 75 , 50 , 33 , 1 , 2 , 3 ] #NEWLINE# info = host . DomainJobInfo . for_domain ( self . dom ) #NEWLINE# self . assertIsInstance ( info , host . DomainJobInfo ) #NEWLINE# self . assertEqual ( fakelibvirt . VIR_DOMAIN_JOB_UNBOUNDED , info . type ) #NEWLINE# self . assertEqual ( 100 , info . time_elapsed ) #NEWLINE# self . assertEqual ( 99 , info . time_remaining ) #NEWLINE# self . assertEqual ( 10 , info . data_total ) #NEWLINE# self . assertEqual ( 11 , info . data_processed ) #NEWLINE# self . assertEqual ( 12 , info . data_remaining ) #NEWLINE# self . assertEqual ( 75 , info . memory_total ) #NEWLINE# self . assertEqual ( 50 , info . memory_processed ) #NEWLINE# self . assertEqual ( 33 , info . memory_remaining ) #NEWLINE# self . assertEqual ( 1 , info . disk_total ) #NEWLINE# self . assertEqual ( 2 , info . disk_processed ) #NEWLINE# self . assertEqual ( 3 , info . disk_remaining ) #NEWLINE# mock_stats . assert_called_once_with ( ) #NEWLINE# mock_info . assert_called_once_with ( )