Merge "Register ResourceWithResourceID in HeatTestCase"
This commit is contained in:
commit
44f2e2a143
|
@ -33,9 +33,11 @@ from heat.engine.clients.os import neutron
|
||||||
from heat.engine.clients.os import nova
|
from heat.engine.clients.os import nova
|
||||||
from heat.engine.clients.os import trove
|
from heat.engine.clients.os import trove
|
||||||
from heat.engine import environment
|
from heat.engine import environment
|
||||||
|
from heat.engine import resource
|
||||||
from heat.engine import resources
|
from heat.engine import resources
|
||||||
from heat.engine import scheduler
|
from heat.engine import scheduler
|
||||||
from heat.tests import fakes
|
from heat.tests import fakes
|
||||||
|
from heat.tests import generic_resource as generic_rsrc
|
||||||
from heat.tests import utils
|
from heat.tests import utils
|
||||||
|
|
||||||
|
|
||||||
|
@ -119,8 +121,13 @@ class HeatTestCase(testscenarios.WithScenarios,
|
||||||
if mock_keystone:
|
if mock_keystone:
|
||||||
self.stub_keystoneclient()
|
self.stub_keystoneclient()
|
||||||
utils.setup_dummy_db()
|
utils.setup_dummy_db()
|
||||||
|
self.register_test_resources()
|
||||||
self.addCleanup(utils.reset_dummy_db)
|
self.addCleanup(utils.reset_dummy_db)
|
||||||
|
|
||||||
|
def register_test_resources(self):
|
||||||
|
resource._register_class('ResourceWithResourceIDType',
|
||||||
|
generic_rsrc.ResourceWithResourceID)
|
||||||
|
|
||||||
def stub_wallclock(self):
|
def stub_wallclock(self):
|
||||||
"""
|
"""
|
||||||
Overrides scheduler wallclock to speed up tests expecting timeouts.
|
Overrides scheduler wallclock to speed up tests expecting timeouts.
|
||||||
|
|
|
@ -459,8 +459,6 @@ class StackUpdateTest(common.HeatTestCase):
|
||||||
mock_create.assert_called_once_with()
|
mock_create.assert_called_once_with()
|
||||||
|
|
||||||
def test_update_modify_replace_failed_create_and_delete_1(self):
|
def test_update_modify_replace_failed_create_and_delete_1(self):
|
||||||
resource._register_class('ResourceWithResourceIDType',
|
|
||||||
generic_rsrc.ResourceWithResourceID)
|
|
||||||
tmpl = {'HeatTemplateFormatVersion': '2012-12-12',
|
tmpl = {'HeatTemplateFormatVersion': '2012-12-12',
|
||||||
'Resources': {'AResource': {'Type':
|
'Resources': {'AResource': {'Type':
|
||||||
'ResourceWithResourceIDType',
|
'ResourceWithResourceIDType',
|
||||||
|
@ -514,8 +512,6 @@ class StackUpdateTest(common.HeatTestCase):
|
||||||
[mock.call(None), mock.call('b_res'), mock.call('a_res')])
|
[mock.call(None), mock.call('b_res'), mock.call('a_res')])
|
||||||
|
|
||||||
def test_update_modify_replace_failed_create_and_delete_2(self):
|
def test_update_modify_replace_failed_create_and_delete_2(self):
|
||||||
resource._register_class('ResourceWithResourceIDType',
|
|
||||||
generic_rsrc.ResourceWithResourceID)
|
|
||||||
tmpl = {'HeatTemplateFormatVersion': '2012-12-12',
|
tmpl = {'HeatTemplateFormatVersion': '2012-12-12',
|
||||||
'Resources': {'AResource': {'Type':
|
'Resources': {'AResource': {'Type':
|
||||||
'ResourceWithResourceIDType',
|
'ResourceWithResourceIDType',
|
||||||
|
@ -571,8 +567,6 @@ class StackUpdateTest(common.HeatTestCase):
|
||||||
mock.call('a_res')])
|
mock.call('a_res')])
|
||||||
|
|
||||||
def test_update_modify_replace_create_in_progress_and_delete_1(self):
|
def test_update_modify_replace_create_in_progress_and_delete_1(self):
|
||||||
resource._register_class('ResourceWithResourceIDType',
|
|
||||||
generic_rsrc.ResourceWithResourceID)
|
|
||||||
tmpl = {'HeatTemplateFormatVersion': '2012-12-12',
|
tmpl = {'HeatTemplateFormatVersion': '2012-12-12',
|
||||||
'Resources': {'AResource': {'Type':
|
'Resources': {'AResource': {'Type':
|
||||||
'ResourceWithResourceIDType',
|
'ResourceWithResourceIDType',
|
||||||
|
@ -627,8 +621,6 @@ class StackUpdateTest(common.HeatTestCase):
|
||||||
[mock.call(None), mock.call('b_res'), mock.call('a_res')])
|
[mock.call(None), mock.call('b_res'), mock.call('a_res')])
|
||||||
|
|
||||||
def test_update_modify_replace_create_in_progress_and_delete_2(self):
|
def test_update_modify_replace_create_in_progress_and_delete_2(self):
|
||||||
resource._register_class('ResourceWithResourceIDType',
|
|
||||||
generic_rsrc.ResourceWithResourceID)
|
|
||||||
tmpl = {'HeatTemplateFormatVersion': '2012-12-12',
|
tmpl = {'HeatTemplateFormatVersion': '2012-12-12',
|
||||||
'Resources': {'AResource': {'Type':
|
'Resources': {'AResource': {'Type':
|
||||||
'ResourceWithResourceIDType',
|
'ResourceWithResourceIDType',
|
||||||
|
|
Loading…
Reference in New Issue