Example #1
0
def test_list_nonces(real_actor_id):
    '''Ensure various properties are present and the right class'''
    r = Reactor()
    nonce = r.add_nonce(permission='READ', maxuses=1, actorId=real_actor_id)
    nonce_id = nonce.get('id')
    nonces = r.list_nonces(actorId=real_actor_id)
    assert isinstance(nonces, list)
    count_nonces = len(nonces)
    assert count_nonces >= 1
    r.delete_nonce(nonce_id, actorId=real_actor_id)
Example #2
0
def test_add_delete_nonce(real_actor_id, tenant_id):
    '''Ensure various properties are present and the right class'''
    r = Reactor()
    nonce = r.add_nonce(permission='READ', maxuses=1, actorId=real_actor_id)
    assert 'id' in nonce
    nonce_id = nonce.get('id')
    assert nonce_id != ''
    # Nonces include the tenant ID to allow for routing upstream of APIM
    assert nonce_id.upper().startswith(tenant_id.upper())
    deleted = r.delete_nonce(nonce_id, actorId=real_actor_id)
    assert deleted is None