diff --git a/heat/tests/constraints/test_heat_constraints.py b/heat/tests/constraints/test_heat_constraints.py index e962c68266..c32045aa01 100644 --- a/heat/tests/constraints/test_heat_constraints.py +++ b/heat/tests/constraints/test_heat_constraints.py @@ -48,7 +48,7 @@ class ResourceTypeConstraintTest(common.HeatTestCase): # Verify self.assertFalse(result) - self.assertTrue('OS::Heat::None' in self.constraint._error_message) + self.assertIn('OS::Heat::None', self.constraint._error_message) self.mock_env.get_class.assert_called_once_with(value[0]) def test_validate_multiple_failures(self): diff --git a/heat/tests/openstack/heat/test_resource_chain.py b/heat/tests/openstack/heat/test_resource_chain.py index 504df6cc85..d1f1497a37 100644 --- a/heat/tests/openstack/heat/test_resource_chain.py +++ b/heat/tests/openstack/heat/test_resource_chain.py @@ -121,7 +121,7 @@ class ResourceChainTest(common.HeatTestCase): # No error, but no resources to create self.assertTrue('resources' not in tmpl) # Sanity check that it's actually a template - self.assertTrue('heat_template_version' in tmpl) + self.assertIn('heat_template_version', tmpl) def test_validate_nested_stack(self): # Test - should not raise exception @@ -145,7 +145,7 @@ class ResourceChainTest(common.HeatTestCase): chain.validate_nested_stack() self.fail('Exception expected') except exception.StackValidationFailed as e: - self.assertTrue('unknown property group' in e.message.lower()) + self.assertIn('unknown property group', e.message.lower()) def test_validate_fake_resource_type(self): # Setup @@ -161,8 +161,8 @@ class ResourceChainTest(common.HeatTestCase): chain.validate_nested_stack() self.fail('Exception expected') except exception.StackValidationFailed as e: - self.assertTrue('could not be found' in e.message.lower()) - self.assertTrue('foo' in e.message) + self.assertIn('could not be found', e.message.lower()) + self.assertIn('foo', e.message) @mock.patch.object(resource_chain.ResourceChain, 'create_with_template') def test_handle_create(self, mock_create): diff --git a/heat/tests/test_signal.py b/heat/tests/test_signal.py index 611e0bff5f..16e1a4a7db 100644 --- a/heat/tests/test_signal.py +++ b/heat/tests/test_signal.py @@ -206,7 +206,7 @@ class SignalTest(common.HeatTestCase): # Test first_url = rsrc.FnGetAtt('signal') - self.assertTrue('alarm_url' in first_url) + self.assertIn('alarm_url', first_url) mock_has.assert_called_once_with('signal_handler') mock_has.reset_mock() # reset the count for the next check @@ -355,7 +355,7 @@ class SignalTest(common.HeatTestCase): # Test first_url = rsrc.FnGetAtt('signal') - self.assertTrue('alarm_url' in first_url) + self.assertIn('alarm_url', first_url) mock_has.assert_called_once_with('signal_handler') mock_has.reset_mock() # reset the count for the next check diff --git a/heat_integrationtests/functional/test_env_merge.py b/heat_integrationtests/functional/test_env_merge.py index 5e222b85f6..819770a87a 100644 --- a/heat_integrationtests/functional/test_env_merge.py +++ b/heat_integrationtests/functional/test_env_merge.py @@ -92,4 +92,4 @@ class EnvironmentMergingTests(functional_base.FunctionalTestsBase): # by checking to see that it has a value r3b = self.client.resources.get(stack_id, 'r3b') r3b_attrs = r3b.attributes - self.assertTrue('value' in r3b_attrs) + self.assertIn('value', r3b_attrs)