#NEWLINE# def test_oswl_get_last_by_cluster_id_resource_type( self ) : #NEWLINE# #INDENT# cluster_id = 1 #NEWLINE# dt = datetime . datetime . utcnow ( ) #NEWLINE# obj_data = { #NEWLINE# #INDENT# 'cluster_id' : cluster_id , #NEWLINE# 'resource_type' : consts . OSWL_RESOURCE_TYPES . vm , #NEWLINE# 'created_date' : dt . date ( ) , #NEWLINE# 'updated_time' : dt . time ( ) , #NEWLINE# 'resource_checksum' : '' , #NEWLINE# #UNINDENT# } #NEWLINE# obj = OpenStackWorkloadStats . create ( obj_data ) #NEWLINE# self . assertEqual ( OpenStackWorkloadStats . get_last_by ( cluster_id , consts . OSWL_RESOURCE_TYPES . vm ) , obj ) #NEWLINE# self . assertIsNone ( OpenStackWorkloadStats . get_last_by ( 0 , consts . OSWL_RESOURCE_TYPES . vm ) ) #NEWLINE# self . assertIsNone ( OpenStackWorkloadStats . get_last_by ( self , consts . OSWL_RESOURCE_TYPES . tenant ) ) #NEWLINE# OpenStackWorkloadStats . delete ( obj ) #NEWLINE# self . assertIsNone ( OpenStackWorkloadStats . get_last_by ( cluster_id , consts . OSWL_RESOURCE_TYPES . vm ) )