Fix [H405] pep rule in heat_integrationtests
Implements bp docstring-improvements
Change-Id: I7aebbdafef121c3414e6a0260452c1353af62e88
diff --git a/functional/test_autoscaling.py b/functional/test_autoscaling.py
index 9041405..5c2d1af 100644
--- a/functional/test_autoscaling.py
+++ b/functional/test_autoscaling.py
@@ -189,7 +189,9 @@
self.assert_instance_count(stack, 5)
def test_update_group_replace(self):
- """Make sure that during a group update the non updatable
+ """Test case for ensuring non-updatable props case a replacement.
+
+ Make sure that during a group update the non-updatable
properties cause a replacement.
"""
files = {'provider.yaml': self.instance_template}
@@ -219,7 +221,9 @@
self.assertNotEqual(orig_asg_id, rsrc.physical_resource_id)
def test_create_instance_error_causes_group_error(self):
- """If a resource in an instance group fails to be created, the instance
+ """Test create failing a resource in the instance group.
+
+ If a resource in an instance group fails to be created, the instance
group itself will fail and the broken inner resource will remain.
"""
stack_name = self._stack_rand_name()
@@ -252,7 +256,9 @@
self._assert_instance_state(nested_ident, 0, 2)
def test_update_instance_error_causes_group_error(self):
- """If a resource in an instance group fails to be created during an
+ """Test update failing a resource in the instance group.
+
+ If a resource in an instance group fails to be created during an
update, the instance group itself will fail and the broken inner
resource will remain.
"""
@@ -408,9 +414,10 @@
self.assertNotIn(deletes_expected, updt_names)
def test_instance_group_update_replace(self):
- """
- Test simple update replace with no conflict in batch size and
- minimum instances in service.
+ """Test simple update replace.
+
+ Test update replace with no conflict in batch size and minimum
+ instances in service.
"""
updt_template = self.ig_tmpl_with_updt_policy()
grp = updt_template['Resources']['JobServerGroup']
@@ -427,9 +434,10 @@
update_replace=True)
def test_instance_group_update_replace_with_adjusted_capacity(self):
- """
- Test update replace with capacity adjustment due to conflict in
- batch size and minimum instances in service.
+ """Test update replace with capacity adjustment.
+
+ Test update replace with capacity adjustment due to conflict in batch
+ size and minimum instances in service.
"""
updt_template = self.ig_tmpl_with_updt_policy()
grp = updt_template['Resources']['JobServerGroup']
@@ -446,9 +454,7 @@
update_replace=True)
def test_instance_group_update_replace_huge_batch_size(self):
- """
- Test update replace with a huge batch size.
- """
+ """Test update replace with a huge batch size."""
updt_template = self.ig_tmpl_with_updt_policy()
group = updt_template['Resources']['JobServerGroup']
policy = group['UpdatePolicy']['AutoScalingRollingUpdate']
@@ -464,9 +470,7 @@
update_replace=True)
def test_instance_group_update_replace_huge_min_in_service(self):
- """
- Test update replace with a huge number of minimum instances in service.
- """
+ """Update replace with huge number of minimum instances in service."""
updt_template = self.ig_tmpl_with_updt_policy()
group = updt_template['Resources']['JobServerGroup']
policy = group['UpdatePolicy']['AutoScalingRollingUpdate']
@@ -483,7 +487,8 @@
update_replace=True)
def test_instance_group_update_no_replace(self):
- """
+ """Test simple update only and no replace.
+
Test simple update only and no replace (i.e. updated instance flavor
in Launch Configuration) with no conflict in batch size and
minimum instances in service.
@@ -504,7 +509,8 @@
update_replace=False)
def test_instance_group_update_no_replace_with_adjusted_capacity(self):
- """
+ """Test update only and no replace with capacity adjustment.
+
Test update only and no replace (i.e. updated instance flavor in
Launch Configuration) with capacity adjustment due to conflict in
batch size and minimum instances in service.
diff --git a/functional/test_conditional_exposure.py b/functional/test_conditional_exposure.py
index d037712..90f7d7a 100644
--- a/functional/test_conditional_exposure.py
+++ b/functional/test_conditional_exposure.py
@@ -82,7 +82,7 @@
"""
def test_non_admin_forbidden_create_flavors(self):
- """Fail to create Flavor resource w/o admin role
+ """Fail to create Flavor resource w/o admin role.
Integration tests job runs as normal OpenStack user,
and OS::Nova:Flavor is configured to require
diff --git a/functional/test_create_update.py b/functional/test_create_update.py
index 4597d4c..153eb9f 100644
--- a/functional/test_create_update.py
+++ b/functional/test_create_update.py
@@ -332,7 +332,8 @@
self.list_resources(nested_identifier))
def test_stack_update_provider_group(self):
- '''Test two-level nested update.'''
+ """Test two-level nested update."""
+
# Create a ResourceGroup (which creates a nested stack),
# containing provider resources (which create a nested
# stack), thus exercising an update which traverses
@@ -403,10 +404,12 @@
self.list_resources(provider_identifier))
def test_stack_update_with_replacing_userdata(self):
- """Confirm that we can update userdata of instance during updating
- stack by the user of member role.
+ """Test case for updating userdata of instance.
- Make sure that a resource that inherites from StackUser can be deleted
+ Confirm that we can update userdata of instance during updating stack
+ by the user of member role.
+
+ Make sure that a resource that inherits from StackUser can be deleted
during updating stack.
"""
if not self.conf.minimal_image_ref:
diff --git a/functional/test_instance_group.py b/functional/test_instance_group.py
index b8bcc3d..02a2858 100644
--- a/functional/test_instance_group.py
+++ b/functional/test_instance_group.py
@@ -131,6 +131,7 @@
def test_basic_create_works(self):
"""Make sure the working case is good.
+
Note this combines test_override_aws_ec2_instance into this test as
well, which is:
If AWS::EC2::Instance is overridden, InstanceGroup will automatically
@@ -177,8 +178,10 @@
self.assert_instance_count(stack, 5)
def test_update_group_replace(self):
- """Make sure that during a group update the non updatable
- properties cause a replacement.
+ """Test case for ensuring non-updatable props case a replacement.
+
+ Make sure that during a group update the non-updatable properties cause
+ a replacement.
"""
files = {'provider.yaml': self.instance_template}
env = {'resource_registry':
@@ -207,7 +210,9 @@
self.assertNotEqual(orig_asg_id, rsrc.physical_resource_id)
def test_create_instance_error_causes_group_error(self):
- """If a resource in an instance group fails to be created, the instance
+ """Test create failing a resource in the instance group.
+
+ If a resource in an instance group fails to be created, the instance
group itself will fail and the broken inner resource will remain.
"""
stack_name = self._stack_rand_name()
@@ -240,7 +245,9 @@
self._assert_instance_state(nested_ident, 0, 2)
def test_update_instance_error_causes_group_error(self):
- """If a resource in an instance group fails to be created during an
+ """Test update failing a resource in the instance group.
+
+ If a resource in an instance group fails to be created during an
update, the instance group itself will fail and the broken inner
resource will remain.
"""
@@ -376,7 +383,8 @@
self.assertNotIn(deletes_expected, updt_names)
def test_instance_group_update_replace(self):
- """
+ """Test simple update replace with no conflict.
+
Test simple update replace with no conflict in batch size and
minimum instances in service.
"""
@@ -395,7 +403,8 @@
update_replace=True)
def test_instance_group_update_replace_with_adjusted_capacity(self):
- """
+ """Test update replace with capacity adjustment.
+
Test update replace with capacity adjustment due to conflict in
batch size and minimum instances in service.
"""
@@ -414,9 +423,7 @@
update_replace=True)
def test_instance_group_update_replace_huge_batch_size(self):
- """
- Test update replace with a huge batch size.
- """
+ """Test update replace with a huge batch size."""
updt_template = self.ig_tmpl_with_updt_policy()
group = updt_template['Resources']['JobServerGroup']
policy = group['UpdatePolicy']['RollingUpdate']
@@ -432,9 +439,7 @@
update_replace=True)
def test_instance_group_update_replace_huge_min_in_service(self):
- """
- Test update replace with a huge number of minimum instances in service.
- """
+ """Update replace with huge number of minimum instances in service."""
updt_template = self.ig_tmpl_with_updt_policy()
group = updt_template['Resources']['JobServerGroup']
policy = group['UpdatePolicy']['RollingUpdate']
@@ -451,7 +456,8 @@
update_replace=True)
def test_instance_group_update_no_replace(self):
- """
+ """Test simple update only and no replace with no conflict.
+
Test simple update only and no replace (i.e. updated instance flavor
in Launch Configuration) with no conflict in batch size and
minimum instances in service.
@@ -472,7 +478,8 @@
update_replace=False)
def test_instance_group_update_no_replace_with_adjusted_capacity(self):
- """
+ """Test update only and no replace with capacity adjustment.
+
Test update only and no replace (i.e. updated instance flavor in
Launch Configuration) with capacity adjustment due to conflict in
batch size and minimum instances in service.
diff --git a/functional/test_resource_group.py b/functional/test_resource_group.py
index 5335245..4fd70af 100644
--- a/functional/test_resource_group.py
+++ b/functional/test_resource_group.py
@@ -267,11 +267,13 @@
self.assertEqual(initial_rand, updated_rand)
def test_update_nochange_resource_needs_update(self):
- """Test update when the resource definition has changed."""
- # Test the scenario when the ResourceGroup update happens without
- # any changed properties, this can happen if the definition of
- # a contained provider resource changes (files map changes), then
- # the group and underlying nested stack should end up updated.
+ """Test update when the resource definition has changed.
+
+ Test the scenario when the ResourceGroup update happens without
+ any changed properties, this can happen if the definition of
+ a contained provider resource changes (files map changes), then
+ the group and underlying nested stack should end up updated.
+ """
random_templ1 = '''
heat_template_version: 2013-05-23
diff --git a/functional/test_template_resource.py b/functional/test_template_resource.py
index 9609664..dabc924 100644
--- a/functional/test_template_resource.py
+++ b/functional/test_template_resource.py
@@ -195,9 +195,12 @@
self.assertIn('arn:openstack:heat:', test_ref)
def test_transparent_ref(self):
- """With the addition of OS::stack_id we can now use the nested resource
+ """Test using nested resource more transparently.
+
+ With the addition of OS::stack_id we can now use the nested resource
more transparently.
"""
+
nested_templ = '''
heat_template_version: 2014-10-16
resources:
@@ -520,6 +523,7 @@
class TemplateResourceUpdateFailedTest(functional_base.FunctionalTestsBase):
"""Prove that we can do updates on a nested stack to fix a stack."""
+
main_template = '''
HeatTemplateFormatVersion: '2012-12-12'
Resources:
@@ -688,6 +692,7 @@
class TemplateResourceErrorMessageTest(functional_base.FunctionalTestsBase):
"""Prove that nested stack errors don't suck."""
+
template = '''
HeatTemplateFormatVersion: '2012-12-12'
Resources:
@@ -743,7 +748,7 @@
super(TemplateResourceSuspendResumeTest, self).setUp()
def test_suspend_resume(self):
- """Basic test for template resource suspend resume"""
+ """Basic test for template resource suspend resume."""
stack_identifier = self.stack_create(
template=self.main_template,
files={'the.yaml': self.nested_templ}
@@ -755,6 +760,7 @@
class ValidateFacadeTest(test.HeatIntegrationTest):
"""Prove that nested stack errors don't suck."""
+
template = '''
heat_template_version: 2015-10-15
resources: