Satisfy flake8

This commit is contained in:
Aldo Cortesi 2016-05-31 19:58:28 +12:00
parent f62efed304
commit 40a030f215
9 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import six
import abc
@six.add_metaclass(abc.ABCMeta)
class Serializable(object):
"""

View File

@ -3,6 +3,7 @@ from six.moves import urllib
from .. import utils
# PY2 workaround
def decode_parse_result(result, enc):
if hasattr(result, "decode"):

View File

@ -19,7 +19,7 @@ def pretty_size(size):
if x == int(x):
x = int(x)
return str(x) + suf
return "%s%s"%(size, SIZE_TABLE[0][0])
return "%s%s" % (size, SIZE_TABLE[0][0])
def parse_size(s):

View File

@ -8,6 +8,7 @@ import inspect
import six
def always_bytes(unicode_or_bytes, *encode_args):
if isinstance(unicode_or_bytes, six.text_type):
return unicode_or_bytes.encode(*encode_args)

View File

@ -1,6 +1,7 @@
from netlib.http import Headers
from netlib.http import multipart
def test_decode():
boundary = 'somefancyboundary'
headers = Headers(

View File

@ -1,6 +1,7 @@
from netlib import tutils
from netlib.http import url
def test_parse():
with tutils.raises(ValueError):
url.parse("")

View File

@ -1,5 +1,6 @@
from netlib import basetypes
class SerializableDummy(basetypes.Serializable):
def __init__(self, i):
self.i = i

View File

@ -1,5 +1,6 @@
from netlib import human, tutils
def test_parse_size():
assert human.parse_size("0") == 0
assert human.parse_size("0b") == 0