From 33775dd18d76bec1843fa11c142e7858a8fea305 Mon Sep 17 00:00:00 2001 From: jamshale Date: Mon, 2 Dec 2024 17:47:34 +0000 Subject: [PATCH] Add unit test with test wallet config Signed-off-by: jamshale --- acapy_agent/askar/tests/test_profile.py | 29 ++++++++++++++----------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/acapy_agent/askar/tests/test_profile.py b/acapy_agent/askar/tests/test_profile.py index 38a0326ded..15bbbba1ef 100644 --- a/acapy_agent/askar/tests/test_profile.py +++ b/acapy_agent/askar/tests/test_profile.py @@ -3,10 +3,11 @@ import pytest -from ...askar.profile import AskarProfile +from ...askar.profile import AskarProfile, AskarProfileManager from ...config.injection_context import InjectionContext from ...ledger.base import BaseLedger from .. import profile as test_module +from ..profile_anon import AskarAnonProfileManager @pytest.fixture @@ -107,15 +108,17 @@ async def test_profile_manager_transaction(): @pytest.mark.asyncio async def test_profile_manager_store(): - profile = "profileId" - - with mock.patch("acapy_agent.askar.profile.AskarProfile") as AskarProfile: - askar_profile = AskarProfile(None, False, profile_id=profile) - askar_profile.profile_id = profile - askar_profile_session = mock.MagicMock() - askar_profile.store.session.return_value = askar_profile_session - - sessionProfile = test_module.AskarProfileSession(askar_profile, False) - - assert sessionProfile._opener == askar_profile_session - askar_profile.store.session.assert_called_once_with(profile) + config = { + "test": True, + } + context = InjectionContext( + settings=config, + ) + await AskarProfileManager().provision( + context=context, + config=config, + ) + await AskarAnonProfileManager().provision( + context=context, + config=config, + )