'Check parameters section inaccessible using the template as a dict.
Test that the parameters section can\'t be accessed using the template
as a dictionary.'

def test_prevent_parameters_access(self):

    expected_description = 'This    can    be    accessed'
    hot_tpl = template_format.parse('\n                                heat_template_version:    2013-05-23\n                                description:    {0}\n                                parameters:\n                                        foo:\n                                                type:    string\n                                '.format(expected_description))
    tmpl = template.Template(hot_tpl)
    self.assertEqual(expected_description, tmpl['description'])
    err_str = 'can    not    be    accessed    directly'
    keyError = self.assertRaises(KeyError, tmpl.__getitem__, 'parameters')
    self.assertIn(err_str, six.text_type(keyError))
    keyError = self.assertRaises(KeyError, tmpl.__getitem__, 'Parameters')
    self.assertIn(err_str, six.text_type(keyError))
