def test_access_policy_update(self):
    tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'R1': {'Type': 'GenericResourceType'}, 'Policy': {'Type': 'OS::Heat::AccessPolicy', 'Properties': {'AllowedResources': ['R1']}}}}
    self.stack = stack.Stack(self.ctx, 'update_stack_access_policy_test', template.Template(tmpl))
    self.stack.store()
    self.stack.create()
    self.assertEqual((stack.Stack.CREATE, stack.Stack.COMPLETE), self.stack.state)
    tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'R1': {'Type': 'GenericResourceType'}, 'R2': {'Type': 'GenericResourceType'}, 'Policy': {'Type': 'OS::Heat::AccessPolicy', 'Properties': {'AllowedResources': ['R1', 'R2']}}}}
    updated_stack = stack.Stack(self.ctx, 'updated_stack', template.Template(tmpl2))
    self.stack.update(updated_stack)
    self.assertEqual((stack.Stack.UPDATE, stack.Stack.COMPLETE), self.stack.state)
def test_access_policy_update(self):
    tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'R1': {'Type': 'GenericResourceType'}, 'Policy': {'Type': 'OS::Heat::AccessPolicy', 'Properties': {'AllowedResources': ['R1']}}}}
    self.stack = stack.Stack(self.ctx, 'update_stack_access_policy_test', template.Template(tmpl))
    self.stack.store()
    self.stack.create()
    self.assertEqual((stack.Stack.CREATE, stack.Stack.COMPLETE), self.stack.state)
    tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'R1': {'Type': 'GenericResourceType'}, 'R2': {'Type': 'GenericResourceType'}, 'Policy': {'Type': 'OS::Heat::AccessPolicy', 'Properties': {'AllowedResources': ['R1', 'R2']}}}}
    updated_stack = stack.Stack(self.ctx, 'updated_stack', template.Template(tmpl2))
    self.stack.update(updated_stack)
    self.assertEqual((stack.Stack.UPDATE, stack.Stack.COMPLETE), self.stack.state)