#NEWLINE# def test_remove_expired_reservations_no_tenant( self ) : #NEWLINE# #INDENT# with mock . patch ( 'neutron.db.quota.api.utcnow' ) as mock_utcnow : #NEWLINE# #INDENT# mock_utcnow . return_value = datetime . datetime ( 2015 , 5 , 20 , 0 , 0 ) #NEWLINE# resources = { #NEWLINE# #INDENT# 'goals' : 2 , #NEWLINE# 'assists' : 1 , #NEWLINE# #UNINDENT# } #NEWLINE# exp_date_1 = datetime . datetime ( 2014 , 3 , 31 , 14 , 30 ) #NEWLINE# resv_1 = self . _create_reservation ( resources , expiration = exp_date_1 ) #NEWLINE# exp_date_2 = datetime . datetime ( 2015 , 3 , 31 , 14 , 30 ) #NEWLINE# resv_2 = self . _create_reservation ( resources , expiration = exp_date_2 , tenant_id = 'Callejon' ) #NEWLINE# self . assertEqual ( 2 , quota_api . remove_expired_reservations ( self . context ) ) #NEWLINE# self . assertIsNone ( quota_api . get_reservation ( self . context , resv_2 . reservation_id ) ) #NEWLINE# self . assertIsNone ( quota_api . get_reservation ( self . context , resv_1 . reservation_id ) )