def testSendNymFailsForCryptonymIdentifierAndOmittedVerkey( be, do, poolNodesStarted, trusteeCli): parameters = {'dest': createCryptonym(), 'role': Roles.TRUST_ANCHOR.name} be(trusteeCli) do('send NYM dest={dest} role={role}', mapper=parameters, expect=ERROR, within=2)
def testSendGetNymFailsIfCryptonymIsPassedAsDest( be, do, poolNodesStarted, trusteeCli): parameters = { 'dest': createCryptonym() } be(trusteeCli) do('send GET_NYM dest={dest}', mapper=parameters, expect=NYM_NOT_FOUND, within=2)
def testSendGetNymFailsIfCryptonymIsPassedAsDest(be, do, poolNodesStarted, trusteeCli): parameters = {'dest': createCryptonym()} be(trusteeCli) do('send GET_NYM dest={dest}', mapper=parameters, expect=NYM_NOT_FOUND, within=2)
def testSendNymFailsForCryptonymIdentifierAndOmittedVerkey( be, do, poolNodesStarted, trusteeCli): parameters = { 'dest': createCryptonym(), 'role': Roles.TRUST_ANCHOR.name } be(trusteeCli) do('send NYM dest={dest} role={role}', mapper=parameters, expect=ERROR, within=2)
def testSendAttribFailsIfDestIsInvalid(be, do, poolNodesStarted, trusteeCli): cryptonym = createCryptonym() invalidIdentifier = cryptonym[:-4] sendAttribParameters = { 'dest': invalidIdentifier, 'raw': json.dumps({'name': 'Alice'}) } be(trusteeCli) do('send ATTRIB dest={dest} raw={raw}', mapper=sendAttribParameters, expect=ERROR, 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)
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)
def testSendAttribFailsIfDestIsInvalid( be, do, poolNodesStarted, trusteeCli): cryptonym = createCryptonym() invalidIdentifier = cryptonym[:-4] sendAttribParameters = { 'dest': invalidIdentifier, 'raw': json.dumps({ 'name': 'Alice' }) } be(trusteeCli) do('send ATTRIB dest={dest} raw={raw}', mapper=sendAttribParameters, expect=ERROR, within=2)
def testSendNymFailsForCryptonymIdentifierAndMatchedAbbrevVerkey( be, do, poolNodesStarted, trusteeCli): cryptonym = createCryptonym() hexCryptonym = friendlyToHex(cryptonym) abbrevVerkey = '~' + hexToFriendly(hexCryptonym[16:]) parameters = { 'dest': cryptonym, 'verkey': abbrevVerkey, 'role': Roles.TRUST_ANCHOR.name } be(trusteeCli) do('send NYM dest={dest} role={role} verkey={verkey}', mapper=parameters, expect=ERROR, within=2)
def testSendNymFailsForCryptonymIdentifierAndMatchedAbbrevVerkey( be, do, poolNodesStarted, trusteeCli): cryptonym = createCryptonym() hexCryptonym = friendlyToHex(cryptonym) abbrevVerkey = '~' + hexToFriendly(hexCryptonym[16:]) parameters = { 'dest': cryptonym, 'verkey': abbrevVerkey, 'role': Roles.TRUST_ANCHOR.name } be(trusteeCli) do('send NYM dest={dest} role={role} verkey={verkey}', mapper=parameters, expect=ERROR, within=2)
def testSendAttribFailsForNotExistingCryptonymDest(be, do, poolNodesStarted, localTrusteeCli): seed = randomSeed() cryptonym = createCryptonym(seed=seed) userCli = localTrusteeCli newKey(be, do, userCli, seed=seed.decode()) sendAttribParameters = { 'dest': cryptonym, 'raw': json.dumps({'name': 'Alice'}) } be(userCli) do('send ATTRIB dest={dest} raw={raw}', mapper=sendAttribParameters, expect=ERROR, within=2)
def testSendAttribFailsForNotExistingCryptonymDest( be, do, poolNodesStarted, localTrusteeCli): seed = randomSeed() cryptonym = createCryptonym(seed=seed) userCli = localTrusteeCli newKey(be, do, userCli, seed=seed.decode()) sendAttribParameters = { 'dest': cryptonym, 'raw': json.dumps({ 'name': 'Alice' }) } be(userCli) do('send ATTRIB dest={dest} raw={raw}', mapper=sendAttribParameters, expect=ERROR, within=2)