Exemple #1
0
def testSendNymHasInvalidSyntaxIfIdentifierIsOmitted(be, do, poolNodesStarted,
                                                     trusteeCli):

    _, fullVerkey = createUuidIdentifierAndFullVerkey()

    parameters = {'verkey': fullVerkey, 'role': Roles.TRUST_ANCHOR.name}

    be(trusteeCli)
    do('send NYM role={role} verkey={verkey}',
       mapper=parameters,
       expect=INVALID_SYNTAX,
       within=2)
def testSendNymHasInvalidSyntaxIfIdentifierIsOmitted(
        be, do, poolNodesStarted, trusteeCli):

    _, fullVerkey = createUuidIdentifierAndFullVerkey()

    parameters = {
        'verkey': fullVerkey,
        'role': Roles.TRUST_ANCHOR.name
    }

    be(trusteeCli)
    do('send NYM role={role} verkey={verkey}',
       mapper=parameters, expect=INVALID_SYNTAX, within=2)
def testSendNymFailsIfFullVerkeyContainsTilde(
        be, do, poolNodesStarted, trusteeCli):

    uuidIdentifier, fullVerkey = createUuidIdentifierAndFullVerkey()

    parameters = {
        'dest': uuidIdentifier,
        'verkey': '~' + fullVerkey,
        'role': Roles.TRUST_ANCHOR.name
    }

    be(trusteeCli)
    do('send NYM dest={dest} role={role} verkey={verkey}',
       mapper=parameters, expect=ERROR, within=2)
def testSendNymFailsIfFullVerkeyIsHexEncoded(
        be, do, poolNodesStarted, trusteeCli):

    uuidIdentifier, fullVerkey = createUuidIdentifierAndFullVerkey()

    parameters = {
        'dest': uuidIdentifier,
        'verkey': friendlyToHexStr(fullVerkey),
        'role': Roles.TRUST_ANCHOR.name
    }

    be(trusteeCli)
    do('send NYM dest={dest} role={role} verkey={verkey}',
       mapper=parameters, expect=ERROR, within=2)
def testSendNymSucceedsForUuidIdentifierAndFullVerkey(
        be, do, poolNodesStarted, trusteeCli):

    uuidIdentifier, fullVerkey = createUuidIdentifierAndFullVerkey()

    parameters = {
        'dest': uuidIdentifier,
        'verkey': fullVerkey,
        'role': Roles.TRUST_ANCHOR.name
    }

    be(trusteeCli)
    do('send NYM dest={dest} role={role} verkey={verkey}',
       mapper=parameters, expect=NYM_ADDED, within=2)
def testSendNymHasInvalidSyntaxIfUnknownParameterIsPassed(
        be, do, poolNodesStarted, trusteeCli):

    uuidIdentifier, fullVerkey = createUuidIdentifierAndFullVerkey()

    parameters = {
        'dest': uuidIdentifier,
        'verkey': fullVerkey,
        'role': Roles.TRUST_ANCHOR.name,
        'extra': 42
    }

    be(trusteeCli)
    do('send NYM dest={dest} role={role} verkey={verkey} extra={extra}',
       mapper=parameters, expect=INVALID_SYNTAX, within=2)
def testSendNymFailsForCryptonymIdentifierAndFullVerkey(
        be, do, poolNodesStarted, trusteeCli):

    cryptonym = createCryptonym()
    _, fullVerkey = createUuidIdentifierAndFullVerkey()

    parameters = {
        'dest': cryptonym,
        'verkey': fullVerkey,
        'role': Roles.TRUST_ANCHOR.name
    }

    be(trusteeCli)
    do('send NYM dest={dest} role={role} verkey={verkey}',
       mapper=parameters, expect=ERROR, within=2)
Exemple #8
0
def testSendNymFailsIfFullVerkeyContainsTilde(be, do, poolNodesStarted,
                                              trusteeCli):

    uuidIdentifier, fullVerkey = createUuidIdentifierAndFullVerkey()

    parameters = {
        'dest': uuidIdentifier,
        'verkey': '~' + fullVerkey,
        'role': Roles.TRUST_ANCHOR.name
    }

    be(trusteeCli)
    do('send NYM dest={dest} role={role} verkey={verkey}',
       mapper=parameters,
       expect=ERROR,
       within=2)
Exemple #9
0
def testSendNymFailsIfFullVerkeyIsHexEncoded(be, do, poolNodesStarted,
                                             trusteeCli):

    uuidIdentifier, fullVerkey = createUuidIdentifierAndFullVerkey()

    parameters = {
        'dest': uuidIdentifier,
        'verkey': friendlyToHexStr(fullVerkey),
        'role': Roles.TRUST_ANCHOR.name
    }

    be(trusteeCli)
    do('send NYM dest={dest} role={role} verkey={verkey}',
       mapper=parameters,
       expect=ERROR,
       within=2)
Exemple #10
0
def testSendNymSucceedsForUuidIdentifierAndFullVerkey(be, do, poolNodesStarted,
                                                      trusteeCli):

    uuidIdentifier, fullVerkey = createUuidIdentifierAndFullVerkey()

    parameters = {
        'dest': uuidIdentifier,
        'verkey': fullVerkey,
        'role': Roles.TRUST_ANCHOR.name
    }

    be(trusteeCli)
    do('send NYM dest={dest} role={role} verkey={verkey}',
       mapper=parameters,
       expect=NYM_ADDED,
       within=2)
Exemple #11
0
def testSendNymHasInvalidSyntaxIfUnknownParameterIsPassed(
        be, do, poolNodesStarted, trusteeCli):

    uuidIdentifier, fullVerkey = createUuidIdentifierAndFullVerkey()

    parameters = {
        'dest': uuidIdentifier,
        'verkey': fullVerkey,
        'role': Roles.TRUST_ANCHOR.name,
        'extra': 42
    }

    be(trusteeCli)
    do('send NYM dest={dest} role={role} verkey={verkey} extra={extra}',
       mapper=parameters,
       expect=INVALID_SYNTAX,
       within=2)
Exemple #12
0
def testSendNymFailsForCryptonymIdentifierAndFullVerkey(
        be, do, poolNodesStarted, trusteeCli):

    cryptonym = createCryptonym()
    _, fullVerkey = createUuidIdentifierAndFullVerkey()

    parameters = {
        'dest': cryptonym,
        'verkey': fullVerkey,
        'role': Roles.TRUST_ANCHOR.name
    }

    be(trusteeCli)
    do('send NYM dest={dest} role={role} verkey={verkey}',
       mapper=parameters,
       expect=ERROR,
       within=2)