Fix H404/405 violations for tools
There is a lot of H404/405 violations in Tempest now, and that leads
difficult to migrate the code to tempest-lib or the other projects'
repos. This patch fixes these violations for tools for enabling
H404/405 rules on Tempest.
Change-Id: I4e1d78532d8f96edd5fd28a7bd2d62181fe9144b
diff --git a/tools/check_uuid.py b/tools/check_uuid.py
index e21c3d8..a71ad39 100755
--- a/tools/check_uuid.py
+++ b/tools/check_uuid.py
@@ -114,10 +114,8 @@
@staticmethod
def _get_idempotent_id(test_node):
- """
- Return key-value dict with all metadata from @test.idempotent_id
- decorators for test method
- """
+ # Return key-value dict with all metadata from @test.idempotent_id
+ # decorators for test method
idempotent_id = None
for decorator in test_node.decorator_list:
if (hasattr(decorator, 'func') and
@@ -264,8 +262,9 @@
return self._filter_tests(check_uuid_in_meta, tests)
def report_collisions(self, tests):
- """Reports collisions if there are any. Returns true if
- collisions exist.
+ """Reports collisions if there are any.
+
+ Returns true if collisions exist.
"""
uuids = {}
@@ -298,8 +297,9 @@
return bool(self._filter_tests(report, tests))
def report_untagged(self, tests):
- """Reports untagged tests if there are any. Returns true if
- untagged tests exist.
+ """Reports untagged tests if there are any.
+
+ Returns true if untagged tests exist.
"""
def report(module_name, test_name, tests):
error_str = "%s:%s\nmissing @test.idempotent_id('...')\n%s\n" % (
@@ -312,9 +312,7 @@
return bool(self._filter_tests(report, tests))
def fix_tests(self, tests):
- """Add uuids to all tests specified in tests and
- fix it in source files
- """
+ """Add uuids to all tests specified in tests and fix it"""
patcher = SourcePatcher()
for module_name in tests:
add_import_once = True