forked from openwallet-foundation/acapy-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Daniel Bluhm <[email protected]>
- Loading branch information
Showing
4 changed files
with
56 additions
and
17 deletions.
There are no files selected for viewing
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
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,8 @@ | ||
import pytest | ||
|
||
from aries_cloudagent.core.in_memory import InMemoryProfile | ||
|
||
|
||
@pytest.fixture | ||
async def profile(): | ||
yield InMemoryProfile.test_profile() |
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
from aries_cloudagent.core.profile import Profile | ||
import pytest | ||
from oid4vci.v1_0.models.exchange import OID4VCIExchangeRecord | ||
|
||
|
||
@pytest.fixture | ||
def record(): | ||
yield OID4VCIExchangeRecord( | ||
supported_cred_id="456", | ||
credential_subject={"name": "alice"}, | ||
nonce="789", | ||
pin="000", | ||
code="111", | ||
token="222", | ||
) | ||
|
||
|
||
def test_serde(record: OID4VCIExchangeRecord): | ||
serialized = record.serialize() | ||
deserialized = OID4VCIExchangeRecord.deserialize(serialized) | ||
assert record == deserialized | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_save(profile: Profile, record: OID4VCIExchangeRecord): | ||
async with profile.session() as session: | ||
await record.save(session) | ||
loaded = await OID4VCIExchangeRecord.retrieve_by_id(session, record.exchange_id) | ||
assert loaded == record |