def test_new_keys_override_old_keys(self): self.execute([ RecordResourceValue( resource_type='lambda_function', resource_name='myfunction', name='key1', value='OLD', ), RecordResourceValue( resource_type='lambda_function', resource_name='myfunction', name='key1', value='NEW', ) ]) assert self.executor.resource_values == [{ 'name': 'myfunction', 'resource_type': 'lambda_function', 'key1': 'NEW', }]
def test_can_aggregate_multiple_resource_values(self): self.execute([ RecordResourceValue( resource_type='lambda_function', resource_name='myfunction', name='key1', value='value1', ), RecordResourceValue( resource_type='lambda_function', resource_name='myfunction', name='key2', value='value2', ) ]) assert self.executor.resource_values == [{ 'name': 'myfunction', 'resource_type': 'lambda_function', 'key1': 'value1', 'key2': 'value2', }]
def test_can_record_value_directly(self): self.execute([ RecordResourceValue( resource_type='lambda_function', resource_name='myfunction', name='myfunction_arn', value='arn:foo', ) ]) assert self.executor.resource_values == [{ 'name': 'myfunction', 'resource_type': 'lambda_function', 'myfunction_arn': 'arn:foo', }]