Merge "Enable hacking checks"
This commit is contained in:
@@ -160,7 +160,7 @@ class TestClient(testtools.TestCase):
|
||||
self.assertTrue('Accept-Language' not in headers)
|
||||
|
||||
def test_connection_timeout(self):
|
||||
"""Should receive an InvalidEndpoint if connection timeout."""
|
||||
"""Verify a InvalidEndpoint is received if connection times out."""
|
||||
def cb(request, context):
|
||||
raise requests.exceptions.Timeout
|
||||
|
||||
@@ -172,11 +172,9 @@ class TestClient(testtools.TestCase):
|
||||
self.assertIn(self.endpoint, comm_err.message)
|
||||
|
||||
def test_connection_refused(self):
|
||||
"""
|
||||
"""Verify a CommunicationError is received if connection is refused.
|
||||
|
||||
Should receive a CommunicationError if connection refused.
|
||||
And the error should list the host and port that refused the
|
||||
connection
|
||||
The error should list the host and port that refused the connection.
|
||||
"""
|
||||
def cb(request, context):
|
||||
raise requests.exceptions.ConnectionError()
|
||||
|
||||
@@ -440,11 +440,10 @@ class ShellInvalidEndpointandParameterTest(utils.TestCase):
|
||||
class ShellStdinHandlingTests(testtools.TestCase):
|
||||
|
||||
def _fake_update_func(self, *args, **kwargs):
|
||||
"""
|
||||
"""Replace glanceclient.images.update with a fake.
|
||||
|
||||
Function to replace glanceclient.images.update,
|
||||
to determine the parameters that would be supplied with the update
|
||||
request
|
||||
To determine the parameters that would be supplied with the update
|
||||
request.
|
||||
"""
|
||||
|
||||
# Store passed in args
|
||||
@@ -523,7 +522,7 @@ class ShellStdinHandlingTests(testtools.TestCase):
|
||||
)
|
||||
|
||||
def test_image_update_closed_stdin(self):
|
||||
"""
|
||||
"""Test image update with a closed stdin.
|
||||
|
||||
Supply glanceclient with a closed stdin, and perform an image
|
||||
update to an active image. Glanceclient should not attempt to read
|
||||
@@ -542,7 +541,7 @@ class ShellStdinHandlingTests(testtools.TestCase):
|
||||
)
|
||||
|
||||
def test_image_update_opened_stdin(self):
|
||||
"""
|
||||
"""Test image update with an opened stdin.
|
||||
|
||||
Supply glanceclient with a stdin, and perform an image
|
||||
update to an active image. Glanceclient should not allow it.
|
||||
|
||||
@@ -74,7 +74,7 @@ class FakeSchemaAPI(FakeAPI):
|
||||
class RawRequest(object):
|
||||
def __init__(self, headers, body=None,
|
||||
version=1.0, status=200, reason="Ok"):
|
||||
"""
|
||||
"""A crafted request object used for testing.
|
||||
|
||||
:param headers: dict representing HTTP response headers
|
||||
:param body: file-like object
|
||||
@@ -101,7 +101,7 @@ class RawRequest(object):
|
||||
class FakeResponse(object):
|
||||
def __init__(self, headers=None, body=None,
|
||||
version=1.0, status_code=200, reason="Ok"):
|
||||
"""
|
||||
"""A crafted response object used for testing.
|
||||
|
||||
:param headers: dict representing HTTP response headers
|
||||
:param body: file-like object
|
||||
|
||||
Reference in New Issue
Block a user