#NEWLINE# def collect_for_operational_cluster( self , get_info_mock ) : #NEWLINE# #INDENT# cluster = self . env . create_cluster ( api = False , status = consts . CLUSTER_STATUSES . operational ) #NEWLINE# cls_id = cluster . id #NEWLINE# get_info_mock . return_value = self . vms_info #NEWLINE# oswl_collect_once ( consts . OSWL_RESOURCE_TYPES . vm ) #NEWLINE# last = OpenStackWorkloadStats . get_last_by ( cls_id , consts . OSWL_RESOURCE_TYPES . vm ) #NEWLINE# upd_time = last . updated_time #NEWLINE# res_data = { #NEWLINE# #INDENT# 'added' : [ { #NEWLINE# #INDENT# 'time' : upd_time . isoformat ( ) , #NEWLINE# 'id' : 1 , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'removed' : [ ] , #NEWLINE# 'modified' : [ ] , #NEWLINE# 'current' : get_info_mock . vms_info , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqual ( last . resource_data , res_data ) #NEWLINE# return ( cls_id , res_data )