py34: test_sahara/software_deployment
* Sort the output for consistent checking in tests * don't use %(x)r, instead use %('x')s. repr flattens the unicode literal too along with the string. partial blueprint heat-python34-support Change-Id: I77b1c4a41aaf3d54008ec0a24be219e0292131d0
This commit is contained in:
parent
d5aa987c29
commit
ee22a90133
|
@ -586,8 +586,8 @@ class BaseCustomConstraint(object):
|
||||||
|
|
||||||
def error(self, value):
|
def error(self, value):
|
||||||
if self._error_message is None:
|
if self._error_message is None:
|
||||||
return _("Error validating value %(value)r") % {"value": value}
|
return _("Error validating value '%(value)s'") % {"value": value}
|
||||||
return _("Error validating value %(value)r: %(message)s") % {
|
return _("Error validating value '%(value)s': %(message)s") % {
|
||||||
"value": value, "message": self._error_message}
|
"value": value, "message": self._error_message}
|
||||||
|
|
||||||
def validate(self, value, context):
|
def validate(self, value, context):
|
||||||
|
|
|
@ -216,7 +216,7 @@ class SaharaNodeGroupTemplateTest(common.HeatTestCase):
|
||||||
ex = self.assertRaises(exception.StackValidationFailed, ngt.validate)
|
ex = self.assertRaises(exception.StackValidationFailed, ngt.validate)
|
||||||
self.assertEqual(u"Property error: "
|
self.assertEqual(u"Property error: "
|
||||||
u"resources.node-group.properties.flavor: "
|
u"resources.node-group.properties.flavor: "
|
||||||
u"Error validating value u'm1.large'",
|
u"Error validating value 'm1.large'",
|
||||||
six.text_type(ex))
|
six.text_type(ex))
|
||||||
|
|
||||||
def test_template_invalid_name(self):
|
def test_template_invalid_name(self):
|
||||||
|
|
|
@ -378,28 +378,38 @@ class SoftwareDeploymentTest(common.HeatTestCase):
|
||||||
self.deployment.handle_create()
|
self.deployment.handle_create()
|
||||||
|
|
||||||
self.assertEqual(sd['id'], self.deployment.resource_id)
|
self.assertEqual(sd['id'], self.deployment.resource_id)
|
||||||
|
call_arg = self.rpc_client.create_software_config.call_args[1]
|
||||||
|
call_arg['inputs'] = sorted(
|
||||||
|
call_arg['inputs'], key=lambda k: k['name'])
|
||||||
self.assertEqual({
|
self.assertEqual({
|
||||||
'config': '',
|
'config': '',
|
||||||
'group': 'Heat::Ungrouped',
|
'group': 'Heat::Ungrouped',
|
||||||
'name': self.deployment.physical_resource_name(),
|
'name': self.deployment.physical_resource_name(),
|
||||||
'inputs': [{
|
'inputs': [{
|
||||||
'name': 'foo',
|
|
||||||
'type': 'String',
|
|
||||||
'value': 'bar'
|
|
||||||
}, {
|
|
||||||
'name': 'bink',
|
'name': 'bink',
|
||||||
'type': 'String',
|
'type': 'String',
|
||||||
'value': 'bonk'
|
'value': 'bonk'
|
||||||
|
}, {
|
||||||
|
'description': 'Name of the current action being deployed',
|
||||||
|
'name': 'deploy_action',
|
||||||
|
'type': 'String',
|
||||||
|
'value': 'CREATE'
|
||||||
|
}, {
|
||||||
|
'description': 'Name of this deployment resource in the stack',
|
||||||
|
'name': 'deploy_resource_name',
|
||||||
|
'type': 'String',
|
||||||
|
'value': 'deployment_mysql'
|
||||||
}, {
|
}, {
|
||||||
'description': 'ID of the server being deployed to',
|
'description': 'ID of the server being deployed to',
|
||||||
'name': 'deploy_server_id',
|
'name': 'deploy_server_id',
|
||||||
'type': 'String',
|
'type': 'String',
|
||||||
'value': '9f1f0e00-05d2-4ca5-8602-95021f19c9d0'
|
'value': '9f1f0e00-05d2-4ca5-8602-95021f19c9d0'
|
||||||
}, {
|
}, {
|
||||||
'description': 'Name of the current action being deployed',
|
'description': ('How the server should signal to heat with '
|
||||||
'name': 'deploy_action',
|
'the deployment output values.'),
|
||||||
|
'name': 'deploy_signal_transport',
|
||||||
'type': 'String',
|
'type': 'String',
|
||||||
'value': 'CREATE'
|
'value': 'NO_SIGNAL'
|
||||||
}, {
|
}, {
|
||||||
'description': 'ID of the stack this deployment belongs to',
|
'description': 'ID of the stack this deployment belongs to',
|
||||||
'name': 'deploy_stack_id',
|
'name': 'deploy_stack_id',
|
||||||
|
@ -407,20 +417,13 @@ class SoftwareDeploymentTest(common.HeatTestCase):
|
||||||
'value': ('software_deployment_test_stack'
|
'value': ('software_deployment_test_stack'
|
||||||
'/42f6f66b-631a-44e7-8d01-e22fb54574a9')
|
'/42f6f66b-631a-44e7-8d01-e22fb54574a9')
|
||||||
}, {
|
}, {
|
||||||
'description': 'Name of this deployment resource in the stack',
|
'name': 'foo',
|
||||||
'name': 'deploy_resource_name',
|
|
||||||
'type': 'String',
|
'type': 'String',
|
||||||
'value': 'deployment_mysql'
|
'value': 'bar'
|
||||||
}, {
|
|
||||||
'description': ('How the server should signal to heat with '
|
|
||||||
'the deployment output values.'),
|
|
||||||
'name': 'deploy_signal_transport',
|
|
||||||
'type': 'String',
|
|
||||||
'value': 'NO_SIGNAL'
|
|
||||||
}],
|
}],
|
||||||
'options': None,
|
'options': None,
|
||||||
'outputs': None
|
'outputs': None
|
||||||
}, self.rpc_client.create_software_config.call_args[1])
|
}, call_arg)
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
{'action': 'CREATE',
|
{'action': 'CREATE',
|
||||||
|
|
|
@ -123,11 +123,13 @@ heat.tests.test_rpc_listener_client
|
||||||
heat.tests.test_rpc_worker_client
|
heat.tests.test_rpc_worker_client
|
||||||
heat.tests.test_rsrc_defn
|
heat.tests.test_rsrc_defn
|
||||||
heat.tests.test_sahara_cluster
|
heat.tests.test_sahara_cluster
|
||||||
|
heat.tests.test_sahara_templates
|
||||||
heat.tests.test_scaling_template
|
heat.tests.test_scaling_template
|
||||||
heat.tests.test_server_tags
|
heat.tests.test_server_tags
|
||||||
heat.tests.test_short_id
|
heat.tests.test_short_id
|
||||||
heat.tests.test_software_component
|
heat.tests.test_software_component
|
||||||
heat.tests.test_software_config
|
heat.tests.test_software_config
|
||||||
|
heat.tests.test_software_deployment
|
||||||
heat.tests.test_stack
|
heat.tests.test_stack
|
||||||
heat.tests.test_stack_collect_attributes
|
heat.tests.test_stack_collect_attributes
|
||||||
heat.tests.test_stack_delete
|
heat.tests.test_stack_delete
|
||||||
|
|
Loading…
Reference in New Issue