Esempio n. 1
0
 def test_basic(self):
     sot = stack_template.StackTemplate()
     self.assertFalse(sot.allow_create)
     self.assertTrue(sot.allow_fetch)
     self.assertFalse(sot.allow_commit)
     self.assertFalse(sot.allow_delete)
     self.assertFalse(sot.allow_list)
Esempio n. 2
0
 def test_make_it(self):
     sot = stack_template.StackTemplate(**FAKE)
     self.assertEqual(FAKE['description'], sot.description)
     self.assertEqual(FAKE['heat_template_version'],
                      sot.heat_template_version)
     self.assertEqual(FAKE['outputs'], sot.outputs)
     self.assertEqual(FAKE['parameters'], sot.parameters)
     self.assertEqual(FAKE['resources'], sot.resources)
Esempio n. 3
0
 def test_basic(self):
     sot = stack_template.StackTemplate()
     self.assertEqual('orchestration', sot.service.service_type)
     self.assertFalse(sot.allow_create)
     self.assertTrue(sot.allow_get)
     self.assertFalse(sot.allow_update)
     self.assertFalse(sot.allow_delete)
     self.assertFalse(sot.allow_list)
Esempio n. 4
0
    def test_to_dict_without_conditions(self):
        fake_sot = copy.deepcopy(FAKE)
        fake_sot['parameter_groups'] = [{
            "description": "server parameters",
            "parameters": ["key_name", "image_id"],
            "label": "server_parameters"}]
        fake_sot.pop('conditions')

        for temp_version in ['2013-05-23', '2014-10-16', '2015-04-30',
                             '2015-10-15', '2016-04-08']:
            fake_sot['heat_template_version'] = temp_version
            sot = stack_template.StackTemplate(**fake_sot)
            self.assertEqual(fake_sot, sot.to_dict())
Esempio n. 5
0
    def test_to_dict(self):
        fake_sot = copy.deepcopy(FAKE)
        fake_sot['parameter_groups'] = [{
            "description": "server parameters",
            "parameters": ["key_name", "image_id"],
            "label": "server_parameters"}]

        for temp_version in ['2016-10-14', '2017-02-24', '2017-02-24',
                             '2017-09-01', '2018-03-02', 'newton',
                             'ocata', 'pike', 'queens']:
            fake_sot['heat_template_version'] = temp_version
            sot = stack_template.StackTemplate(**fake_sot)
            self.assertEqual(fake_sot, sot.to_dict())