Skip to content

Commit

Permalink
linting
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 4ba384d commit 2d9b12a
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions aries_cloudagent/vc/vc_di/tests/test_cryptosuites.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ class TestEddsaJcs2022:
"type": "DataIntegrityProof",
"cryptosuite": "eddsa-jcs-2022",
"proofPurpose": "assertionMethod",
"verificationMethod": "did:key:z6MkgKA7yrw5kYSiDuQFcye4bMaJpcfHFry3Bx45pdWh3s8i#z6MkgKA7yrw5kYSiDuQFcye4bMaJpcfHFry3Bx45pdWh3s8i"
"verificationMethod": "did:key:z6MkgKA7yrw5kYSiDuQFcye4bMaJpcfHFry3Bx45pdWh3s8i#z6MkgKA7yrw5kYSiDuQFcye4bMaJpcfHFry3Bx45pdWh3s8i",
}

async def asyncSetUp(self):
self.profile = InMemoryProfile.test_profile()
self.cryptosuite = CRYPTOSUITES[self.options["cryptosuite"]](
profile=self.profile
)
self.cryptosuite = CRYPTOSUITES[self.options["cryptosuite"]](profile=self.profile)
await InMemoryWallet(self.profile).create_signing_key(
key_type=ED25519, seed=self.test_seed
)

async def test_add_proof(self):
secured_document = self.cryptosuite.add_proof(self.unsecured_document, self.options)
secured_document = self.cryptosuite.add_proof(
self.unsecured_document, self.options
)
proof = secured_document.pop("proof", None)
assert isinstance(proof, list)
assert len(proof) == 1
Expand All @@ -41,7 +41,9 @@ async def test_add_proof(self):
assert proof["proofValue"]

async def test_proof_set(self):
secured_document = self.cryptosuite.add_proof(self.unsecured_document, self.options)
secured_document = self.cryptosuite.add_proof(
self.unsecured_document, self.options
)
secured_document = self.cryptosuite.add_proof(secured_document, self.options)
proof_set = proof_set.pop("proof", None)
assert isinstance(proof_set, list)
Expand All @@ -54,15 +56,19 @@ async def test_proof_set(self):
assert proof["proofValue"]

async def test_eddsa_jcs_2022_verify_proof(self):
secured_document = self.cryptosuite.add_proof(self.unsecured_document, self.options)
secured_document = self.cryptosuite.add_proof(
self.unsecured_document, self.options
)
proof = secured_document.pop("proof", None)
assert await self.cryptosuite.verify_proof(secured_document, proof)
bad_proof = proof.copy()
bad_proof["proofValue"] = bad_proof["proofValue"][:-1]
assert not await self.cryptosuite.verify_proof(secured_document, proof)

async def test_eddsa_jcs_2022_verify_proof_set(self):
secured_document = self.cryptosuite.add_proof(self.unsecured_document, self.options)
secured_document = self.cryptosuite.add_proof(
self.unsecured_document, self.options
)
secured_document = self.cryptosuite.add_proof(secured_document, self.options)
proof_set = secured_document.pop("proof", None)
for proof in proof_set:
Expand Down

0 comments on commit 2d9b12a

Please sign in to comment.