summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnn Kamyshnikova <akamyshnikova@mirantis.com>2013-06-25 17:12:58 +0400
committerAnn Kamyshnikova <akamyshnikova@mirantis.com>2013-06-25 17:12:58 +0400
commit455c1f66e404bdb02ef4b2af8cc2a5adf0f4d2a0 (patch)
treeb5caf11b8b4b4aa41faa8775290d922397f3edaa
parent51c28cd5d922b5212a2fc237ddca4245282a72af (diff)
downloadoslo-middleware-455c1f66e404bdb02ef4b2af8cc2a5adf0f4d2a0.tar.gz
Enable H302 hacking check
This change requires hacking >0.5.5 Change-Id: Ic36fa0502548335d433f3fbe663854523dd04397
-rw-r--r--openstack/common/middleware/sizelimit.py2
-rw-r--r--tests/unit/middleware/test_sizelimit.py10
2 files changed, 6 insertions, 6 deletions
diff --git a/openstack/common/middleware/sizelimit.py b/openstack/common/middleware/sizelimit.py
index 96a1fbf..ecbdde1 100644
--- a/openstack/common/middleware/sizelimit.py
+++ b/openstack/common/middleware/sizelimit.py
@@ -23,7 +23,7 @@ import webob.dec
import webob.exc
from openstack.common.deprecated import wsgi
-from openstack.common.gettextutils import _
+from openstack.common.gettextutils import _ # noqa
from openstack.common.middleware import base
diff --git a/tests/unit/middleware/test_sizelimit.py b/tests/unit/middleware/test_sizelimit.py
index 22098d0..7579659 100644
--- a/tests/unit/middleware/test_sizelimit.py
+++ b/tests/unit/middleware/test_sizelimit.py
@@ -13,7 +13,7 @@
# under the License.
from oslo.config import cfg
-from six import StringIO
+import six
import webob
from openstack.common.middleware import sizelimit
@@ -28,14 +28,14 @@ class TestLimitingReader(utils.BaseTestCase):
def test_limiting_reader(self):
BYTES = 1024
bytes_read = 0
- data = StringIO("*" * BYTES)
+ data = six.StringIO("*" * BYTES)
for chunk in sizelimit.LimitingReader(data, BYTES):
bytes_read += len(chunk)
self.assertEquals(bytes_read, BYTES)
bytes_read = 0
- data = StringIO("*" * BYTES)
+ data = six.StringIO("*" * BYTES)
reader = sizelimit.LimitingReader(data, BYTES)
byte = reader.read(1)
while len(byte) != 0:
@@ -49,7 +49,7 @@ class TestLimitingReader(utils.BaseTestCase):
def _consume_all_iter():
bytes_read = 0
- data = StringIO("*" * BYTES)
+ data = six.StringIO("*" * BYTES)
for chunk in sizelimit.LimitingReader(data, BYTES - 1):
bytes_read += len(chunk)
@@ -58,7 +58,7 @@ class TestLimitingReader(utils.BaseTestCase):
def _consume_all_read():
bytes_read = 0
- data = StringIO("*" * BYTES)
+ data = six.StringIO("*" * BYTES)
reader = sizelimit.LimitingReader(data, BYTES - 1)
byte = reader.read(1)
while len(byte) != 0: