-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add test for oob_record mutli_use
Signed-off-by: Colton Wolkins (Indicio work address) <[email protected]>
- Loading branch information
1 parent
b8c4238
commit d31d2a9
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
aries_cloudagent/protocols/out_of_band/v1_0/models/tests/test_out_of_band.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import pytest | ||
|
||
from ..oob_record import OobRecord | ||
from ...messages.invitation import InvitationMessage | ||
from ......core.in_memory import InMemoryProfile | ||
from ......core.profile import ProfileSession | ||
|
||
|
||
@pytest.fixture() | ||
async def session(): | ||
profile = InMemoryProfile.test_profile() | ||
async with profile.session() as session: | ||
yield session | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_oob_record_multi_use(session: ProfileSession): | ||
"""Test oob record multi_use.""" | ||
invi_msg = InvitationMessage(handshake_protocols=["connections/1.0"]) | ||
oob_rec = OobRecord( | ||
state=OobRecord.STATE_INITIAL, | ||
invi_msg_id="67890", | ||
role=OobRecord.ROLE_SENDER, | ||
invitation=invi_msg, | ||
multi_use=True, | ||
) | ||
|
||
await oob_rec.save(session) | ||
saved_record = await OobRecord.retrieve_by_id(session, record_id=oob_rec.oob_id) | ||
assert saved_record | ||
assert isinstance(saved_record, OobRecord) | ||
assert oob_rec.multi_use | ||
assert saved_record.multi_use | ||
|