aws-cloudformation / cloudformation-cli-python-plugin

The CloudFormation Provider Development Toolkit Python Plugin allows you to autogenerate Python code based on an input schema.
Apache License 2.0
108 stars 45 forks source link

When using OOTB CFN Test is broken with 'Tags' attribute on generated class #248

Open carpnick opened 1 year ago

carpnick commented 1 year ago

Assuming same steps in https://github.com/aws-cloudformation/cloudformation-cli-python-plugin/issues/247, using the workaround to get by the current cryptography issue.

After trying to run one test cfn test -- -k contract_create_delete, it fails with:

Traceback (most recent call last):
  File "/var/task/cloudformation_cli_python_lib/resource.py", line 165, in _cast_resource_request
    return UnmodelledRequest(
  File "/var/task/cloudformation_cli_python_lib/utils.py", line 156, in to_modelled
    desiredResourceState=model_cls._deserialize(self.desiredResourceState),
  File "/var/task/dd_dd_dd/models.py", line 74, in _deserialize
    Tags=set_or_none(json_data.get("Tags")),
  File "/var/task/dd_dd_dd/models.py", line 30, in set_or_none
    return set(value)
TypeError: unhashable type: 'dict'

Root cause and fix: