#NEWLINE# def test_get_valid_resource_commitment( self ) : #NEWLINE# #INDENT# from pyon.util.containers import get_ion_ts_millis #NEWLINE# ion_org = IonObject ( RT . Org , name = 'ION' ) #NEWLINE# ( ion_org_id , _ ) = self . rr . create ( ion_org ) #NEWLINE# ion_org . _id = ion_org_id #NEWLINE# actor = IonObject ( RT . ActorIdentity , name = 'actor1' ) #NEWLINE# ( actor_id , _ ) = self . rr . create ( actor ) #NEWLINE# ts = ( get_ion_ts_millis ( ) - 50000 ) #NEWLINE# com_obj = IonObject ( RT . Commitment , provider = ion_org_id , consumer = actor_id , commitment = True , expiration = ts ) #NEWLINE# ( com_id , _ ) = self . rr . create ( com_obj ) #NEWLINE# id = self . rr . create_association ( ion_org_id , PRED . hasCommitment , com_id ) #NEWLINE# c = get_valid_resource_commitments ( ion_org_id , actor_id ) #NEWLINE# self . assertIsNone ( c ) #NEWLINE# ts = ( get_ion_ts_millis ( ) + 50000 ) #NEWLINE# com_obj = IonObject ( RT . Commitment , provider = ion_org_id , consumer = actor_id , commitment = True , expiration = ts ) #NEWLINE# ( com_id , _ ) = self . rr . create ( com_obj ) #NEWLINE# id = self . rr . create_association ( ion_org_id , PRED . hasCommitment , com_id ) #NEWLINE# c = get_valid_resource_commitments ( ion_org_id , actor_id ) #NEWLINE# self . assertIsNotNone ( c )