#NEWLINE# @ mock . patch . object ( fakelibvirt . virDomain , 'jobInfo' ) #NEWLINE# @ mock . patch . object ( fakelibvirt . virDomain , 'jobStats' ) #NEWLINE# def test_job_stats( self , mock_stats , mock_info ) : #NEWLINE# #INDENT# mock_stats . return_value = { #NEWLINE# #INDENT# 'type' : fakelibvirt . VIR_DOMAIN_JOB_UNBOUNDED , #NEWLINE# 'memory_total' : 75 , #NEWLINE# 'memory_processed' : 50 , #NEWLINE# 'memory_remaining' : 33 , #NEWLINE# 'some_new_libvirt_stat_we_dont_know_about' : 83 , #NEWLINE# #UNINDENT# } #NEWLINE# info = host . DomainJobInfo . for_domain ( self . dom ) #NEWLINE# self . assertIsInstance ( mock_stats , host . DomainJobInfo ) #NEWLINE# self . assertEqual ( fakelibvirt . VIR_DOMAIN_JOB_UNBOUNDED , info . type ) #NEWLINE# self . assertEqual ( 75 , info . memory_total ) #NEWLINE# self . assertEqual ( 50 , info . memory_processed ) #NEWLINE# self . assertEqual ( 33 , info . memory_remaining ) #NEWLINE# self . assertEqual ( 0 , info . disk_total ) #NEWLINE# self . assertEqual ( 0 , info . disk_processed ) #NEWLINE# self . assertEqual ( 0 , info . disk_remaining ) #NEWLINE# mock_stats . assert_called_once_with ( ) #NEWLINE# self . assertFalse ( mock_info . called )