Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: jamshale <[email protected]>
  • Loading branch information
jamshale committed Nov 6, 2024
1 parent aadae16 commit a34b675
Show file tree
Hide file tree
Showing 12 changed files with 377 additions and 299 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
)
from base58 import alphabet

from ......scenarios.examples.anoncreds_issuance_and_revocation.example import (
SchemaResult,
)
from .....anoncreds.base import AnonCredsSchemaAlreadyExists
from .....anoncreds.default.legacy_indy import registry as test_module
from .....anoncreds.issuer import AnonCredsIssuer
Expand Down Expand Up @@ -53,7 +50,7 @@
RevRegDefState,
RevRegDefValue,
)
from ....models.schema import AnonCredsSchema, GetSchemaResult
from ....models.schema import AnonCredsSchema, GetSchemaResult, SchemaResult

B58 = alphabet if isinstance(alphabet, str) else alphabet.decode("ascii")
INDY_DID = rf"^(did:sov:)?[{B58}]{{21,22}}$"
Expand Down
2 changes: 1 addition & 1 deletion acapy_agent/anoncreds/models/proof.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ class Meta:
keys=fields.Str(),
values=fields.Nested(RawEncodedSchema),
metadata={
"description": "Anoncreds proof requested proof revealed attr groups group value"
"description": "Anoncreds proof requested proof revealed attr groups group value" # noqa: E501
},
)

Expand Down
4 changes: 2 additions & 2 deletions acapy_agent/anoncreds/models/requested_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


class AnoncredsRequestedCredsRequestedAttrSchema(OpenAPISchema):
"""Schema for requested attributes within anoncreds requested credentials structure."""
"""Schema for requested attributes within anoncreds requested creds structure."""

cred_id = fields.Str(
required=True,
Expand All @@ -25,7 +25,7 @@ class AnoncredsRequestedCredsRequestedAttrSchema(OpenAPISchema):


class AnoncredsRequestedCredsRequestedPredSchema(OpenAPISchema):
"""Schema for requested predicates within anoncreds requested credentials structure."""
"""Schema for requested predicates within anoncreds requested creds structure."""

cred_id = fields.Str(
required=True,
Expand Down
4 changes: 2 additions & 2 deletions acapy_agent/indy/models/cred_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(
self.xr_cap = xr_cap


class AnoncredsCorrectnessProofSchema(BaseModelSchema):
class IndyKeyCorrectnessProofSchema(BaseModelSchema):
"""Indy key correctness proof schema."""

class Meta:
Expand Down Expand Up @@ -149,7 +149,7 @@ class Meta:
},
)
key_correctness_proof = fields.Nested(
AnoncredsCorrectnessProofSchema(),
IndyKeyCorrectnessProofSchema(),
required=True,
metadata={"description": "Key correctness proof"},
)
16 changes: 0 additions & 16 deletions acapy_agent/messaging/valid.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,22 +947,6 @@ def __init__(
)


class IndyOrKeyDID(Regexp):
"""Indy or Key DID class."""

PATTERN = "|".join(x.pattern for x in [DIDKey.PATTERN, IndyDID.PATTERN])
EXAMPLE = IndyDID.EXAMPLE

def __init__(
self,
):
"""Initialize the instance."""
super().__init__(
IndyOrKeyDID.PATTERN,
error="Value {input} is not in did:key or indy did format",
)


# Instances for marshmallow schema specification
INT_EPOCH_VALIDATE = IntEpoch()
INT_EPOCH_EXAMPLE = IntEpoch.EXAMPLE
Expand Down
Loading

0 comments on commit a34b675

Please sign in to comment.