Merge "Replace assertRaisesRegexp with assertRaisesRegex"

This commit is contained in:
Jenkins 2017-05-21 18:00:11 +00:00 committed by Gerrit Code Review
commit 0677bb8005
19 changed files with 108 additions and 108 deletions

View File

@ -481,9 +481,9 @@ class VolumeTest(vt_base.BaseVolumeTest):
stack = utils.parse_stack(self.t, stack_name=stack_name)
rsrc = self.create_volume(self.t, stack, 'DataVolume')
deleter = scheduler.TaskRunner(rsrc.destroy)
self.assertRaisesRegexp(exception.ResourceFailure,
".*ResourceInError.*error_deleting.*delete",
deleter)
self.assertRaisesRegex(exception.ResourceFailure,
".*ResourceInError.*error_deleting.*delete",
deleter)
self.m.VerifyAll()

View File

@ -401,8 +401,8 @@ class AodhAlarmTest(common.HeatTestCase):
msg = ("Property error: Resources.MEMAlarmHigh.Properties.%s: "
"int\(\) argument must be a string(, a bytes-like "
"object)? or a number, not 'list'" % p)
self.assertRaisesRegexp(exception.StackValidationFailed,
msg, rsrc.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg, rsrc.validate)
def test_mem_alarm_high_check_not_required_parameters(self):
snippet = template_format.parse(not_string_alarm_template)

View File

@ -170,9 +170,9 @@ class TestContainer(common.HeatTestCase):
defn = rsrc_defn.ResourceDefinition(
'failed_container', 'OS::Barbican::GenericContainer', props)
res = container.GenericContainer('foo', defn, stack)
self.assertRaisesRegexp(exception.StackValidationFailed,
'Duplicate refs are not allowed',
res.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
'Duplicate refs are not allowed',
res.validate)
def test_attributes(self):
mock_container = mock.Mock()

View File

@ -87,11 +87,11 @@ class TestOrder(common.HeatTestCase):
del props['type']
snippet = self.res_template.freeze(properties=props)
self.assertRaisesRegexp(exception.ResourceFailure,
'Property type not assigned',
self._create_resource,
'foo',
snippet, self.stack)
self.assertRaisesRegex(exception.ResourceFailure,
'Property type not assigned',
self._create_resource,
'foo',
snippet, self.stack)
def test_validate_non_certificate_order(self):
props = self.props.copy()
@ -101,9 +101,9 @@ class TestOrder(common.HeatTestCase):
res = self._create_resource('test', snippet, self.stack)
msg = ("Properties algorithm and bit_length are required for "
"key type of order.")
self.assertRaisesRegexp(exception.StackValidationFailed,
msg,
res.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg,
res.validate)
def test_validate_certificate_with_profile_without_ca_id(self):
props = self.props.copy()
@ -112,9 +112,9 @@ class TestOrder(common.HeatTestCase):
snippet = self.res_template.freeze(properties=props)
res = self._create_resource('test', snippet, self.stack)
msg = ("profile cannot be specified without ca_id.")
self.assertRaisesRegexp(exception.ResourcePropertyDependency,
msg,
res.validate)
self.assertRaisesRegex(exception.ResourcePropertyDependency,
msg,
res.validate)
def test_key_order_validation_fail(self):
props = self.props.copy()
@ -124,9 +124,9 @@ class TestOrder(common.HeatTestCase):
msg = ("Unexpected properties: pass_phrase. Only these properties "
"are allowed for key type of order: algorithm, "
"bit_length, expiration, mode, name, payload_content_type.")
self.assertRaisesRegexp(exception.StackValidationFailed,
msg,
res.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg,
res.validate)
def test_certificate_validation_fail(self):
props = self.props.copy()
@ -137,9 +137,9 @@ class TestOrder(common.HeatTestCase):
"these properties are allowed for certificate type of order: "
"ca_id, name, profile, request_data, request_type, "
"source_container_ref, subject_dn.")
self.assertRaisesRegexp(exception.StackValidationFailed,
msg,
res.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg,
res.validate)
def test_asymmetric_order_validation_fail(self):
props = self.props.copy()
@ -150,9 +150,9 @@ class TestOrder(common.HeatTestCase):
msg = ("Unexpected properties: subject_dn. Only these properties are "
"allowed for asymmetric type of order: algorithm, bit_length, "
"expiration, mode, name, pass_phrase, payload_content_type")
self.assertRaisesRegexp(exception.StackValidationFailed,
msg,
res.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg,
res.validate)
def test_attributes(self):
mock_order = mock.Mock()

View File

@ -145,8 +145,8 @@ class TestSecret(common.HeatTestCase):
props)
res = self._create_resource(defn.name, defn, self.stack)
msg = "payload_content_type cannot be specified without payload."
self.assertRaisesRegexp(exception.ResourcePropertyDependency,
msg, res.validate)
self.assertRaisesRegex(exception.ResourcePropertyDependency,
msg, res.validate)
def test_validate_octet_stream_without_encoding(self):
props = {
@ -161,8 +161,8 @@ class TestSecret(common.HeatTestCase):
msg = ("Property unspecified. For 'application/octet-stream' value of "
"'payload_content_type' property, 'payload_content_encoding' "
"property must be specified.")
self.assertRaisesRegexp(exception.StackValidationFailed,
msg, res.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg, res.validate)
def test_validate_base64(self):
props = {
@ -177,8 +177,8 @@ class TestSecret(common.HeatTestCase):
res = self._create_resource(defn.name, defn, self.stack)
msg = ("Invalid payload for specified 'base64' value of "
"'payload_content_encoding' property.")
self.assertRaisesRegexp(exception.StackValidationFailed,
msg, res.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg, res.validate)
def test_validate_encoding_dependency(self):
props = {
@ -194,5 +194,5 @@ class TestSecret(common.HeatTestCase):
msg = ("payload_content_encoding property should only be specified "
"for payload_content_type with value "
"application/octet-stream.")
self.assertRaisesRegexp(exception.ResourcePropertyValueDependency,
msg, res.validate)
self.assertRaisesRegex(exception.ResourcePropertyValueDependency,
msg, res.validate)

View File

@ -109,8 +109,8 @@ class CinderQuotaTest(common.HeatTestCase):
my_quota.reparse()
msg = ('At least one of the following properties must be specified: '
'gigabytes, snapshots, volumes.')
self.assertRaisesRegexp(exception.PropertyUnspecifiedError, msg,
my_quota.validate)
self.assertRaisesRegex(exception.PropertyUnspecifiedError, msg,
my_quota.validate)
def test_quota_handle_create(self):
self.my_quota.physical_resource_name = mock.MagicMock(

View File

@ -227,7 +227,7 @@ class ManilaShareTest(common.HeatTestCase):
properties = tmp['resources']['test_share']['properties']
properties['access_rules'][0]['access_type'] = 'domain'
stack = utils.parse_stack(tmp, stack_name='access_type')
self.assertRaisesRegexp(
self.assertRaisesRegex(
exception.StackValidationFailed,
".* \"domain\" is not an allowed value \[ip, user, cert, cephx\]",
stack.validate)

View File

@ -167,8 +167,8 @@ class ManilaShareNetworkTest(common.HeatTestCase):
net.is_using_neutron = mock.Mock(return_value=True)
msg = ('Provided neutron_subnet does not belong '
'to provided neutron_network.')
self.assertRaisesRegexp(exception.StackValidationFailed, msg,
net.validate)
self.assertRaisesRegex(exception.StackValidationFailed, msg,
net.validate)
def test_update(self):
net = self._create_network('share_network', self.rsrc_defn, self.stack)
@ -227,8 +227,8 @@ class ManilaShareNetworkTest(common.HeatTestCase):
net = self._create_network('share_network', rsrc_defn, stack)
msg = ('Cannot define the following properties at the same time: '
'neutron_network, nova_network.')
self.assertRaisesRegexp(exception.ResourcePropertyConflict, msg,
net.validate)
self.assertRaisesRegex(exception.ResourcePropertyConflict, msg,
net.validate)
def test_nova_net_neutron_subnet_conflict(self):
t = template_format.parse(stack_template)
@ -239,8 +239,8 @@ class ManilaShareNetworkTest(common.HeatTestCase):
net = self._create_network('share_network', rsrc_defn, stack)
msg = ('Cannot define the following properties at the same time: '
'neutron_subnet, nova_network.')
self.assertRaisesRegexp(exception.ResourcePropertyConflict, msg,
net.validate)
self.assertRaisesRegex(exception.ResourcePropertyConflict, msg,
net.validate)
def test_nova_net_while_using_neutron(self):
t = template_format.parse(stack_template)
@ -253,8 +253,8 @@ class ManilaShareNetworkTest(common.HeatTestCase):
net.is_using_neutron = mock.Mock(return_value=True)
msg = ('With Neutron enabled you need to pass Neutron network '
'and Neutron subnet instead of Nova network')
self.assertRaisesRegexp(exception.StackValidationFailed, msg,
net.validate)
self.assertRaisesRegex(exception.StackValidationFailed, msg,
net.validate)
def test_neutron_net_without_neutron_subnet(self):
t = template_format.parse(stack_template)
@ -263,8 +263,8 @@ class ManilaShareNetworkTest(common.HeatTestCase):
rsrc_defn = stack.t.resource_definitions(stack)['share_network']
net = self._create_network('share_network', rsrc_defn, stack)
msg = ('neutron_network cannot be specified without neutron_subnet.')
self.assertRaisesRegexp(exception.ResourcePropertyDependency, msg,
net.validate)
self.assertRaisesRegex(exception.ResourcePropertyDependency, msg,
net.validate)
def test_attributes(self):
net = self._create_network('share_network', self.rsrc_defn,

View File

@ -101,8 +101,8 @@ class MistralCronTriggerTest(common.HeatTestCase):
ct = self._create_resource('trigger', self.rsrc_defn, self.stack)
msg = ("At least one of the following properties must be specified: "
"pattern, first_time")
self.assertRaisesRegexp(exception.PropertyUnspecifiedError, msg,
ct.validate)
self.assertRaisesRegex(exception.PropertyUnspecifiedError, msg,
ct.validate)
def test_validate_ok_without_first_time(self):
t = template_format.parse(stack_template)

View File

@ -62,8 +62,8 @@ class L7PolicyTest(common.HeatTestCase):
'required when action type is set to REJECT.')
with mock.patch('heat.engine.clients.os.neutron.NeutronClientPlugin.'
'has_extension', return_value=True):
self.assertRaisesRegexp(exception.StackValidationFailed,
msg, self.l7policy.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg, self.l7policy.validate)
def test_validate_redirect_pool_action_with_url(self):
tmpl = yaml.load(inline_templates.L7POLICY_TEMPLATE)
@ -76,8 +76,8 @@ class L7PolicyTest(common.HeatTestCase):
'for action with value REDIRECT_TO_URL.')
with mock.patch('heat.engine.clients.os.neutron.NeutronClientPlugin.'
'has_extension', return_value=True):
self.assertRaisesRegexp(exception.ResourcePropertyValueDependency,
msg, self.l7policy.validate)
self.assertRaisesRegex(exception.ResourcePropertyValueDependency,
msg, self.l7policy.validate)
def test_validate_redirect_pool_action_without_pool(self):
tmpl = yaml.load(inline_templates.L7POLICY_TEMPLATE)
@ -90,8 +90,8 @@ class L7PolicyTest(common.HeatTestCase):
'is set to REDIRECT_TO_POOL.')
with mock.patch('heat.engine.clients.os.neutron.NeutronClientPlugin.'
'has_extension', return_value=True):
self.assertRaisesRegexp(exception.StackValidationFailed,
msg, self.l7policy.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg, self.l7policy.validate)
def test_validate_redirect_url_action_with_pool(self):
tmpl = yaml.load(inline_templates.L7POLICY_TEMPLATE)
@ -103,8 +103,8 @@ class L7PolicyTest(common.HeatTestCase):
'for action with value REDIRECT_TO_POOL.')
with mock.patch('heat.engine.clients.os.neutron.NeutronClientPlugin.'
'has_extension', return_value=True):
self.assertRaisesRegexp(exception.ResourcePropertyValueDependency,
msg, self.l7policy.validate)
self.assertRaisesRegex(exception.ResourcePropertyValueDependency,
msg, self.l7policy.validate)
def test_validate_redirect_url_action_without_url(self):
tmpl = yaml.load(inline_templates.L7POLICY_TEMPLATE)
@ -116,8 +116,8 @@ class L7PolicyTest(common.HeatTestCase):
'is set to REDIRECT_TO_URL.')
with mock.patch('heat.engine.clients.os.neutron.NeutronClientPlugin.'
'has_extension', return_value=True):
self.assertRaisesRegexp(exception.StackValidationFailed,
msg, self.l7policy.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg, self.l7policy.validate)
def test_create(self):
self._create_stack()

View File

@ -62,8 +62,8 @@ class L7RuleTest(common.HeatTestCase):
'specified for rules of HEADER and COOKIE types.')
with mock.patch('heat.engine.clients.os.neutron.NeutronClientPlugin.'
'has_extension', return_value=True):
self.assertRaisesRegexp(exception.StackValidationFailed,
msg, self.l7rule.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg, self.l7rule.validate)
def test_create(self):
self._create_stack()

View File

@ -60,8 +60,8 @@ class PoolTest(common.HeatTestCase):
'session_persistence type is set to APP_COOKIE.')
with mock.patch('heat.engine.clients.os.neutron.NeutronClientPlugin.'
'has_extension', return_value=True):
self.assertRaisesRegexp(exception.StackValidationFailed,
msg, self.pool.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg, self.pool.validate)
def test_validate_source_ip_cookie_name(self):
tmpl = yaml.load(inline_templates.POOL_TEMPLATE)
@ -74,8 +74,8 @@ class PoolTest(common.HeatTestCase):
'session_persistence type is set to SOURCE_IP.')
with mock.patch('heat.engine.clients.os.neutron.NeutronClientPlugin.'
'has_extension', return_value=True):
self.assertRaisesRegexp(exception.StackValidationFailed,
msg, self.pool.validate)
self.assertRaisesRegex(exception.StackValidationFailed,
msg, self.pool.validate)
def test_create(self):
self._create_stack()

View File

@ -65,16 +65,16 @@ class RBACPolicyTest(common.HeatTestCase):
tpl['resources']['rbac']['properties']['action'] = 'access_as_external'
self._create_stack(tmpl=yaml.safe_dump(tpl))
msg = "Invalid action access_as_external for object type network."
self.assertRaisesRegexp(exception.StackValidationFailed, msg,
self.rbac.validate)
self.assertRaisesRegex(exception.StackValidationFailed, msg,
self.rbac.validate)
def test_validate_invalid_type(self):
tpl = yaml.safe_load(inline_templates.RBAC_TEMPLATE)
tpl['resources']['rbac']['properties']['object_type'] = 'networks'
self._create_stack(tmpl=yaml.safe_dump(tpl))
msg = "Invalid object_type: networks. "
self.assertRaisesRegexp(exception.StackValidationFailed, msg,
self.rbac.validate)
self.assertRaisesRegex(exception.StackValidationFailed, msg,
self.rbac.validate)
def test_update(self):
self._create_stack()

View File

@ -92,8 +92,8 @@ class NeutronQuotaTest(common.HeatTestCase):
msg = ('At least one of the following properties must be specified: '
'floatingip, network, port, router, '
'security_group, security_group_rule, subnet.')
self.assertRaisesRegexp(exception.PropertyUnspecifiedError, msg,
my_quota.validate)
self.assertRaisesRegex(exception.PropertyUnspecifiedError, msg,
my_quota.validate)
def test_quota_handle_create(self):
self.my_quota.physical_resource_name = mock.MagicMock(

View File

@ -114,8 +114,8 @@ class NovaQuotaTest(common.HeatTestCase):
'injected_file_path_bytes, injected_files, instances, '
'key_pairs, metadata_items, ram, security_group_rules, '
'security_groups, server_group_members, server_groups.')
self.assertRaisesRegexp(exception.PropertyUnspecifiedError, msg,
my_quota.validate)
self.assertRaisesRegex(exception.PropertyUnspecifiedError, msg,
my_quota.validate)
def test_quota_handle_create(self):
self.my_quota.physical_resource_name = mock.MagicMock(

View File

@ -178,9 +178,9 @@ class ValidateTest(common.HeatTestCase):
def test_validate_func(self):
self.assertIsNone(function.validate(self.func))
self.func = TestFunction(None, 'foo', ['bar'])
self.assertRaisesRegexp(exception.StackValidationFailed,
'.foo: Need more arguments',
function.validate, self.func)
self.assertRaisesRegex(exception.StackValidationFailed,
'.foo: Need more arguments',
function.validate, self.func)
def test_validate_dict(self):
snippet = {'foo': 'bar', 'blarg': self.func}
@ -188,9 +188,9 @@ class ValidateTest(common.HeatTestCase):
self.func = TestFunction(None, 'foo', ['bar'])
snippet = {'foo': 'bar', 'blarg': self.func}
self.assertRaisesRegexp(exception.StackValidationFailed,
'.blarg.foo: Need more arguments',
function.validate, snippet)
self.assertRaisesRegex(exception.StackValidationFailed,
'.blarg.foo: Need more arguments',
function.validate, snippet)
def test_validate_list(self):
snippet = ['foo', 'bar', 'baz', 'blarg', self.func]
@ -198,9 +198,9 @@ class ValidateTest(common.HeatTestCase):
self.func = TestFunction(None, 'foo', ['bar'])
snippet = {'foo': 'bar', 'blarg': self.func}
self.assertRaisesRegexp(exception.StackValidationFailed,
'.blarg.foo: Need more arguments',
function.validate, snippet)
self.assertRaisesRegex(exception.StackValidationFailed,
'.blarg.foo: Need more arguments',
function.validate, snippet)
def test_validate_all(self):
snippet = ['foo', {'bar': ['baz', {'blarg': self.func}]}]
@ -208,9 +208,9 @@ class ValidateTest(common.HeatTestCase):
self.func = TestFunction(None, 'foo', ['bar'])
snippet = {'foo': 'bar', 'blarg': self.func}
self.assertRaisesRegexp(exception.StackValidationFailed,
'.blarg.foo: Need more arguments',
function.validate, snippet)
self.assertRaisesRegex(exception.StackValidationFailed,
'.blarg.foo: Need more arguments',
function.validate, snippet)
class DependenciesTest(common.HeatTestCase):

View File

@ -1165,52 +1165,52 @@ class HOTemplateTest(common.HeatTestCase):
{'keys': {'f2': 'f1'}}]}
tmpl = template.Template(hot_newton_tpl_empty)
msg = "key replacement f1 collides with a key in the input map"
self.assertRaisesRegexp(ValueError, msg, self.resolve, snippet, tmpl)
self.assertRaisesRegex(ValueError, msg, self.resolve, snippet, tmpl)
def test_map_replace_replaced_keys_collide(self):
snippet = {'map_replace': [{'f1': 'b1', 'f2': 'b2'},
{'keys': {'f1': 'f3', 'f2': 'f3'}}]}
tmpl = template.Template(hot_newton_tpl_empty)
msg = "key replacement f3 collides with a key in the output map"
self.assertRaisesRegexp(ValueError, msg, self.resolve, snippet, tmpl)
self.assertRaisesRegex(ValueError, msg, self.resolve, snippet, tmpl)
def test_map_replace_invalid_str_arg1(self):
snippet = {'map_replace': 'ab'}
tmpl = template.Template(hot_newton_tpl_empty)
msg = "Incorrect arguments to \"map_replace\" should be:"
self.assertRaisesRegexp(TypeError, msg, self.resolve, snippet, tmpl)
self.assertRaisesRegex(TypeError, msg, self.resolve, snippet, tmpl)
def test_map_replace_invalid_str_arg2(self):
snippet = {'map_replace': [{'f1': 'b1', 'f2': 'b2'}, "ab"]}
tmpl = template.Template(hot_newton_tpl_empty)
msg = ("Incorrect arguments: to \"map_replace\", "
"arguments must be a list of maps")
self.assertRaisesRegexp(TypeError, msg, self.resolve, snippet, tmpl)
self.assertRaisesRegex(TypeError, msg, self.resolve, snippet, tmpl)
def test_map_replace_invalid_empty(self):
snippet = {'map_replace': []}
tmpl = template.Template(hot_newton_tpl_empty)
msg = "Incorrect arguments to \"map_replace\" should be:"
self.assertRaisesRegexp(TypeError, msg, self.resolve, snippet, tmpl)
self.assertRaisesRegex(TypeError, msg, self.resolve, snippet, tmpl)
def test_map_replace_invalid_missing1(self):
snippet = {'map_replace': [{'f1': 'b1', 'f2': 'b2'}]}
tmpl = template.Template(hot_newton_tpl_empty)
msg = "Incorrect arguments to \"map_replace\" should be:"
self.assertRaisesRegexp(TypeError, msg, self.resolve, snippet, tmpl)
self.assertRaisesRegex(TypeError, msg, self.resolve, snippet, tmpl)
def test_map_replace_invalid_missing2(self):
snippet = {'map_replace': [{'keys': {'f1': 'f3', 'f2': 'f3'}}]}
tmpl = template.Template(hot_newton_tpl_empty)
msg = "Incorrect arguments to \"map_replace\" should be:"
self.assertRaisesRegexp(TypeError, msg, self.resolve, snippet, tmpl)
self.assertRaisesRegex(TypeError, msg, self.resolve, snippet, tmpl)
def test_map_replace_invalid_wrongkey(self):
snippet = {'map_replace': [{'f1': 'b1', 'f2': 'b2'},
{'notkeys': {'f2': 'F2'}}]}
tmpl = template.Template(hot_newton_tpl_empty)
msg = "Incorrect arguments to \"map_replace\" should be:"
self.assertRaisesRegexp(ValueError, msg, self.resolve, snippet, tmpl)
self.assertRaisesRegex(ValueError, msg, self.resolve, snippet, tmpl)
def test_yaql(self):
snippet = {'yaql': {'expression': '$.data.var1.sum()',
@ -1267,8 +1267,8 @@ class HOTemplateTest(common.HeatTestCase):
snippet = {'yaql': 'invalid'}
tmpl = template.Template(hot_newton_tpl_empty)
msg = '.yaql: Arguments to "yaql" must be a map.'
self.assertRaisesRegexp(exception.StackValidationFailed,
msg, self.resolve, snippet, tmpl)
self.assertRaisesRegex(exception.StackValidationFailed,
msg, self.resolve, snippet, tmpl)
def test_yaql_invalid_expression(self):
snippet = {'yaql': {'expression': 'invalid(',
@ -1277,8 +1277,8 @@ class HOTemplateTest(common.HeatTestCase):
yaql = tmpl.parse(None, snippet)
regxp = ('.yaql: Bad expression Parse error: unexpected end '
'of statement.')
self.assertRaisesRegexp(exception.StackValidationFailed, regxp,
function.validate, yaql)
self.assertRaisesRegex(exception.StackValidationFailed, regxp,
function.validate, yaql)
def test_yaql_data_as_function(self):
snippet = {'yaql': {'expression': '$.data.var1.len()',
@ -1543,8 +1543,8 @@ conditions:
repeat = tmpl.parse(None, snippet)
regxp = ('.repeat: The "for_each" argument to "repeat" '
'must contain a map')
self.assertRaisesRegexp(exception.StackValidationFailed, regxp,
function.validate, repeat)
self.assertRaisesRegex(exception.StackValidationFailed, regxp,
function.validate, repeat)
def test_digest(self):
snippet = {'digest': ['md5', 'foobar']}
@ -1795,10 +1795,10 @@ conditions:
stack = parser.Stack(utils.dummy_context(), 'test_stack',
template.Template(hot_juno_tpl_empty))
regxp = '.Fn::GetAZs: The template version is invalid'
self.assertRaisesRegexp(exception.StackValidationFailed,
regxp,
function.validate,
stack.t.parse(stack, snippet))
self.assertRaisesRegex(exception.StackValidationFailed,
regxp,
function.validate,
stack.t.parse(stack, snippet))
def test_add_resource(self):
hot_tpl = template_format.parse('''

View File

@ -781,7 +781,7 @@ class PropertyTest(common.HeatTestCase):
p = properties.Property(schema)
# python 3.4.3 returns another error message
# try to handle this by regexp
self.assertRaisesRegexp(
self.assertRaisesRegex(
TypeError, "int\(\) argument must be a string(, a bytes-like "
"object)? or a number, not 'list'", p.get_value, [1])

View File

@ -1870,7 +1870,7 @@ class StackTest(common.HeatTestCase):
self.stack = stack.Stack(self.ctx, 'stack_with_correct_outputs',
template.Template(tmpl))
self.assertRaisesRegexp(
self.assertRaisesRegex(
exception.StackValidationFailed,
('Outputs.Resource_attr.Value.Fn::GetAtt: The Referenced '
'Attribute \(AResource Bar\) is incorrect.'),
@ -2233,7 +2233,7 @@ class StackTest(common.HeatTestCase):
self.stack = stack.Stack(self.ctx, 'stack_with_correct_outputs',
template.Template(tmpl))
self.assertRaisesRegexp(
self.assertRaisesRegex(
exception.StackValidationFailed,
('outputs.resource_attr.value.get_attr: The Referenced Attribute '
'\(AResource Bar\) is incorrect.'),