Skip to content

Commit

Permalink
ci: Add test for oob_record mutli_use
Browse files Browse the repository at this point in the history
Signed-off-by: Colton Wolkins (Indicio work address) <[email protected]>
  • Loading branch information
TheTechmage committed Jan 4, 2024
1 parent b8c4238 commit d31d2a9
Showing 1 changed file with 34 additions and 0 deletions.
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

0 comments on commit d31d2a9

Please sign in to comment.