summaryrefslogtreecommitdiff
path: root/glanceclient/tests/unit/test_http.py
diff options
context:
space:
mode:
authorDarja Shakhray <dshakhray@mirantis.com>2015-07-20 17:29:49 +0300
committerDarja Shakhray <dshakhray@mirantis.com>2015-07-21 17:08:27 +0300
commitec0f2dfd8500d230895e286462aaf69c43777038 (patch)
treed3ef94392fe49f222f07a7e33cb2a371185f95f5 /glanceclient/tests/unit/test_http.py
parentd9d586942bf3f78ba174eb5832f60d80a7c839ca (diff)
downloadpython-glanceclient-ec0f2dfd8500d230895e286462aaf69c43777038.tar.gz
Enable flake8 checks
This commit enables new flake8 checks: * E265 block comment should start with '# ' * H405 multi line docstring summary not separated with an empty line * E123 closing bracket does not match indentation of opening bracket's line * H238 old style class declaration, use new style (inherit from `object`) * E128 continuation line under-indented for visual indent and makes related changes in the code. Change-Id: Ie993afc930f6b74d7a990bcaa9fc0e9f5ba1585c
Diffstat (limited to 'glanceclient/tests/unit/test_http.py')
-rw-r--r--glanceclient/tests/unit/test_http.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/glanceclient/tests/unit/test_http.py b/glanceclient/tests/unit/test_http.py
index f83a514..c7a16f3 100644
--- a/glanceclient/tests/unit/test_http.py
+++ b/glanceclient/tests/unit/test_http.py
@@ -77,7 +77,7 @@ class TestClient(testtools.TestCase):
'X-Identity-Status': 'Confirmed',
'X-Service-Catalog': 'service_catalog',
}
- #with token
+ # with token
kwargs = {'token': u'fake-token',
'identity_headers': identity_headers}
http_client_object = http.HTTPClient(self.endpoint, **kwargs)
@@ -93,7 +93,7 @@ class TestClient(testtools.TestCase):
'X-Identity-Status': 'Confirmed',
'X-Service-Catalog': 'service_catalog',
}
- #without X-Auth-Token in identity headers
+ # without X-Auth-Token in identity headers
kwargs = {'token': u'fake-token',
'identity_headers': identity_headers}
http_client_object = http.HTTPClient(self.endpoint, **kwargs)
@@ -140,9 +140,7 @@ class TestClient(testtools.TestCase):
self.assertEqual(v, headers[k])
def test_connection_timeout(self):
- """
- Should receive an InvalidEndpoint if connection timeout.
- """
+ """Should receive an InvalidEndpoint if connection timeout."""
def cb(request, context):
raise requests.exceptions.Timeout
@@ -155,6 +153,7 @@ class TestClient(testtools.TestCase):
def test_connection_refused(self):
"""
+
Should receive a CommunicationError if connection refused.
And the error should list the host and port that refused the
connection
@@ -192,7 +191,7 @@ class TestClient(testtools.TestCase):
self.assertNotIn("none-val", encoded)
def test_raw_request(self):
- " Verify the path being used for HTTP requests reflects accurately. "
+ """Verify the path being used for HTTP requests reflects accurately."""
headers = {"Content-Type": "text/plain"}
text = 'Ok'
path = '/v1/images/detail'