Ejemplo n.º 1
0
 def test_supports_multiple_unreferenced_and_unchanged(self):
     first = create_function_resource('first')
     second = create_function_resource('second')
     third = create_function_resource('third')
     plan = [
         models.RecordResource(
             resource_type='lambda_function',
             resource_name=first.resource_name,
             name='foo',
         ),
         models.RecordResource(
             resource_type='asdf',
             resource_name=second.resource_name,
             name='foo',
         )
     ]
     deployed = {
         'resources': [{
             'name': second.resource_name,
             'resource_type': 'lambda_function',
             'lambda_arn': 'second_arn',
         }, {
             'name': third.resource_name,
             'resource_type': 'lambda_function',
             'lambda_arn': 'third_arn',
         }]
     }
     config = FakeConfig(deployed)
     self.execute(plan, config)
     assert len(plan) == 3
     assert plan[2].method_name == 'delete_function'
     assert plan[2].params == {'function_name': 'third_arn'}
Ejemplo n.º 2
0
 def test_noop_when_all_resources_accounted_for(self, function_resource):
     plan = [
         models.RecordResource(
             resource_type='lambda_function',
             resource_name='myfunction',
             name='foo',
         )
     ]
     original_plan = plan[:]
     deployed = self.one_deployed_lambda_function(name='myfunction')
     config = FakeConfig(deployed)
     self.execute(plan, config)
     # We shouldn't add anything to the list.
     assert plan == original_plan