From c864f5991390a6976f68f97d9724bb4826dc15fa Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Thu, 19 Nov 2015 08:45:06 +0000 Subject: [PATCH] Fix H404/405 violations for unit tests 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 unit tests. Change-Id: Ib2418300b2679bee477c84cd0943382d031ff4a9 --- tempest/tests/base.py | 3 +-- tempest/tests/fake_http.py | 3 ++- tempest/tests/stress/test_stress.py | 3 +-- tempest/tests/test_hacking.py | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tempest/tests/base.py b/tempest/tests/base.py index 27eb2c4849..fe9268e766 100644 --- a/tempest/tests/base.py +++ b/tempest/tests/base.py @@ -26,8 +26,7 @@ class TestCase(base.BaseTestCase): self.stubs = mox_fixture.stubs def patch(self, target, **kwargs): - """ - Returns a started `mock.patch` object for the supplied target. + """Returns a started `mock.patch` object for the supplied target. The caller may then call the returned patcher to create a mock object. diff --git a/tempest/tests/fake_http.py b/tempest/tests/fake_http.py index 7d77484a80..d714055696 100644 --- a/tempest/tests/fake_http.py +++ b/tempest/tests/fake_http.py @@ -50,7 +50,8 @@ class fake_httplib2(object): class fake_httplib(object): def __init__(self, headers, body=None, version=1.0, status=200, reason="Ok"): - """ + """Initialization of fake httplib + :param headers: dict representing HTTP response headers :param body: file-like object :param version: HTTP Version diff --git a/tempest/tests/stress/test_stress.py b/tempest/tests/stress/test_stress.py index 16f1ac7783..0ec2a5d59b 100644 --- a/tempest/tests/stress/test_stress.py +++ b/tempest/tests/stress/test_stress.py @@ -25,8 +25,7 @@ LOG = logging.getLogger(__name__) class StressFrameworkTest(base.TestCase): - """Basic test for the stress test framework. - """ + """Basic test for the stress test framework.""" def _cmd(self, cmd, param): """Executes specified command.""" diff --git a/tempest/tests/test_hacking.py b/tempest/tests/test_hacking.py index 62d2aee2a8..55f00efa4b 100644 --- a/tempest/tests/test_hacking.py +++ b/tempest/tests/test_hacking.py @@ -17,7 +17,8 @@ from tempest.tests import base class HackingTestCase(base.TestCase): - """ + """Test class for hacking rule + This class tests the hacking checks in tempest.hacking.checks by passing strings to the check methods like the pep8/flake8 parser would. The parser loops over each line in the file and then passes the parameters to the