'Check that changes in static environment parameters are not ignored.
Changes in static environment parameters are not ignored and can cause
dependent resources to be updated.'

def test_update_replace_parameters(self):

    tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Parameters': {'AParam': {'Type': 'String'}}, 'Resources': {'AResource': {'Type': 'ResourceWithPropsType', 'Properties': {'Foo': {'Ref': 'AParam'}}}}}
    env1 = environment.Environment({'parameters': {'AParam': 'abc'}})
    env2 = environment.Environment({'parameters': {'AParam': 'smelly'}})
    self.stack = stack.Stack(self.ctx, 'update_test_stack', template.Template(tmpl, env=env1))
    self.stack.store()
    self.stack.create()
    self.assertEqual((stack.Stack.CREATE, stack.Stack.COMPLETE), self.stack.state)
    self.assertEqual('abc', self.stack['AResource']._stored_properties_data['Foo'])
    updated_stack = stack.Stack(self.ctx, 'updated_stack', template.Template(tmpl, env=env2))
    self.stack.update(updated_stack)
    self.assertEqual((stack.Stack.UPDATE, stack.Stack.COMPLETE), self.stack.state)
    self.assertEqual('smelly', self.stack['AResource']._stored_properties_data['Foo'])
