示例#1
0
def test_delete_all_nonces(real_actor_id):
    '''Ensure various properties are present and the right class'''
    r = Reactor()
    for a in range(0, 5):
        r.add_nonce(permission='READ', maxuses=1, actorId=real_actor_id)
    nonces = r.list_nonces(actorId=real_actor_id)
    assert isinstance(nonces, list)
    count_nonces = len(nonces)
    assert count_nonces >= 5
    r.delete_all_nonces(actorId=real_actor_id)
    nonces = r.list_nonces(actorId=real_actor_id)
    assert isinstance(nonces, list)
    count_nonces = len(nonces)
    assert count_nonces == 0
示例#2
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)