Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
be a bit more backwards-compatible: do not deserialise to dict
Browse files Browse the repository at this point in the history
  • Loading branch information
ccwienk committed Jan 17, 2023
1 parent 30f47b6 commit 19f80d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bindings-python/gci/componentmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ class Resource(Artifact, LabelMethodsMixin):
OciAccess,
RelativeOciAccess,
S3Access,
ResourceAccess,
None,
dict,
]
digest: typing.Optional[DigestSpec] = None
extraIdentity: typing.Dict[str, str] = dataclasses.field(default_factory=dict)
Expand Down
4 changes: 2 additions & 2 deletions bindings-python/tests/gci/componentmodel_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def test_deserialisation_of_custom_resources():
component_descriptor = cm.ComponentDescriptor.from_dict(
component_descriptor_dict=component_descriptor_dict,
)
assert isinstance(component_descriptor.component.resources[0].access, dict)
assert isinstance(component_descriptor.component.resources[0].access, cm.ResourceAccess)
assert component_descriptor.component.resources[1].access is None
assert isinstance(component_descriptor.component.resources[2].access, dict)
assert isinstance(component_descriptor.component.resources[2].access, cm.ResourceAccess)
assert isinstance(component_descriptor.component.resources[3].access, cm.RelativeOciAccess)


Expand Down

0 comments on commit 19f80d7

Please sign in to comment.