Esempio n. 1
0
async def test_out_of_band_invitation():
    context = await Context.create_with_config(await get_test_config())
    relationship = Relationship(for_relationship=for_relationship,
                                thread_id=thread_id)

    msg = relationship.out_of_band_invitation_msg(context)

    assert msg['@type'] == '{};spec/{}/{}/{}'.format(
        EVERNYM_MSG_QUALIFIER, Relationship.MSG_FAMILY,
        Relationship.MSG_FAMILY_VERSION, Relationship.OUT_OF_BAND_INVITATION)
    assert msg['@id'] is not None
    assert msg['~thread'] is not None
    assert msg['~thread']['thid'] is not None
    assert msg['~for_relationship'] == for_relationship
    assert msg['goalCode'] == GoalsList.P2P_MESSAGING.value.code
    assert msg['goal'] == GoalsList.P2P_MESSAGING.value.name
    assert 'shortInvite' not in msg
async def test_out_of_band_invitation():
    context = await Context.create_with_config(await get_test_config())
    relationship = Relationship(
        for_relationship='RxRJCMe5XNqc9e9J1YPwhL',
        thread_id='7a80285e-896c-45f6-b386-39ed7c49230c',
        label='test'
    )

    msg = relationship.out_of_band_invitation_msg(context)

    assert msg['@type'] == '{};spec/{}/{}/{}'.format(
        EVERNYM_MSG_QUALIFIER,
        Relationship.MSG_FAMILY,
        Relationship.MSG_FAMILY_VERSION,
        Relationship.OUT_OF_BAND_INVITATION
    )
    assert msg['@id'] is not None
    assert msg['~thread'] is not None
    assert msg['~thread']['thid'] is not None
    assert msg['~for_relationship'] == 'RxRJCMe5XNqc9e9J1YPwhL'
    assert msg['goalCode'] == GoalsList.P2P_MESSAGING.value.code
    assert msg['goal'] == GoalsList.P2P_MESSAGING.value.name