From 49bff70ed55fa126f55b7b30017e2e79ed8d105c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 6 Jun 2024 10:36:23 +0200 Subject: [PATCH] fix tests --- tests/test_certificate.py | 35 +++++++++++++++++++++++++++------- tests/test_interoperability.py | 28 ++++++++++++++++++++------- 2 files changed, 49 insertions(+), 14 deletions(-) diff --git a/tests/test_certificate.py b/tests/test_certificate.py index 60b60c1..009bb35 100644 --- a/tests/test_certificate.py +++ b/tests/test_certificate.py @@ -80,7 +80,10 @@ def test_credential(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did, + "name": "" + }, "issuanceDate": now() } @@ -105,7 +108,10 @@ def test_presentation(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did, + "name": "" + }, "issuanceDate": now() } @@ -136,7 +142,10 @@ def test_verifiable_credential(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did, + "name": "" + }, "issuanceDate": now() } @@ -159,7 +168,10 @@ def test_verifiable_presentation(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did, + "name": "" + }, "issuanceDate": now() } @@ -189,7 +201,10 @@ def test_verifiable_credential_fail(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did, + "name": "" + }, "issuanceDate": now() } @@ -213,7 +228,10 @@ def test_verifiable_presentation_fail1(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did, + "name": "" + }, "issuanceDate": now() } @@ -243,7 +261,10 @@ def test_verifiable_presentation_fail2(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did, + "name": "" + }, "issuanceDate": now() } diff --git a/tests/test_interoperability.py b/tests/test_interoperability.py index f3caadb..ae61daf 100644 --- a/tests/test_interoperability.py +++ b/tests/test_interoperability.py @@ -105,7 +105,9 @@ def test_pyvckit_credential_validated_from_didkit(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did + }, "issuanceDate": now() } @@ -127,7 +129,9 @@ def test_didkit_credential_validated_from_pyvckit(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did + }, "issuanceDate": now() } @@ -149,7 +153,9 @@ def test_pyvckit_presentation_validated_from_didkit(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did + }, "issuanceDate": now() } @@ -179,7 +185,9 @@ def test_fail_pyvckit_presentation_validated_from_didkit(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did + }, "issuanceDate": now() } @@ -213,7 +221,9 @@ def test_didkit_presentation_validated_from_pyvckit(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did + }, "issuanceDate": now() } cred_signed = render_and_sign_credential(credential, key) @@ -239,7 +249,9 @@ def test_fail_didkit_presentation_validated_from_pyvckit(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did + }, "issuanceDate": now() } cred_signed = render_and_sign_credential(credential, key) @@ -268,7 +280,9 @@ def test_fail2_didkit_presentation_validated_from_pyvckit(): "credentialSubject": { "id": "did:key:z6MkgGXSJoacuuNdwU1rGfPpFH72GACnzykKTxzCCTZs6Z2M", }, - "issuer": did, + "issuer": { + "id": did + }, "issuanceDate": now() } cred_signed = render_and_sign_credential(credential, key)