コード例 #1
0
def test_nym_dynamic_validation_for_new_nym(nym_request,
                                            nym_handler: NymHandler, creator):
    nym_handler.write_req_validator.validate = get_exception(False)
    add_to_idr(nym_handler.database_manager.idr_cache, creator, STEWARD)
    nym_handler.dynamic_validation(nym_request)

    nym_handler.write_req_validator.validate = get_exception(True)
    with pytest.raises(UnauthorizedClientRequest):
        nym_handler.dynamic_validation(nym_request)
コード例 #2
0
ファイル: test_nym_handler.py プロジェクト: x-chain/indy-node
def test_nym_dynamic_validation_for_existing_nym_fails_with_no_changes(
        nym_handler: NymHandler, creator):
    nym_request = Request(identifier=creator,
                          reqId=5,
                          operation={
                              'type': NYM,
                              'dest': randomString()
                          })
    add_to_idr(nym_handler.database_manager.idr_cache,
               nym_request.operation['dest'], None)
    add_to_idr(nym_handler.database_manager.idr_cache, creator, STEWARD)

    nym_handler.write_req_validator.validate = get_exception(True)
    with pytest.raises(InvalidClientRequest):
        nym_handler.dynamic_validation(nym_request, 0)