Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick <[email protected]>
  • Loading branch information
PatStLouis committed Sep 15, 2024
1 parent c6d74b0 commit 6cd5c34
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions aries_cloudagent/did/tests/test_did_key_operations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from unittest import IsolatedAsyncioTestCase
from ..did_key import DIDKey
from ...core.in_memory import InMemoryProfile


class TestDIDKeyOperations(IsolatedAsyncioTestCase):
test_seed = "00000000000000000000000000000000"
did = "did:key:z6MkgKA7yrw5kYSiDuQFcye4bMaJpcfHFry3Bx45pdWh3s8i"
kid = "did:key:z6MkgKA7yrw5kYSiDuQFcye4bMaJpcfHFry3Bx45pdWh3s8i#z6MkgKA7yrw5kYSiDuQFcye4bMaJpcfHFry3Bx45pdWh3s8i"
new_kid = "did:web:example.com#key-01"
multikey = "z6MkgKA7yrw5kYSiDuQFcye4bMaJpcfHFry3Bx45pdWh3s8i"
profile = InMemoryProfile.test_profile()

async def test_create_ed25519_did_key(self):
results = await DIDKey().create(
key_type="ed25519", profile=self.profile, seed=self.test_seed
)
assert results["did"] == self.did
assert results["kid"] == self.kid
assert results["multikey"] == self.multikey

async def test_bind_did_key(self):
results = await DIDKey().create(
key_type="ed25519", profile=self.profile, seed=self.test_seed
)
results = await DIDKey().bind(did=results["did"], kid=self.new_kid)
assert results["did"] == self.did
assert results["kid"] == self.new_kid
assert results["multikey"] == self.multikey

0 comments on commit 6cd5c34

Please sign in to comment.