mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Satisfy flake8
This commit is contained in:
parent
f62efed304
commit
40a030f215
@ -1,6 +1,7 @@
|
||||
import six
|
||||
import abc
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class Serializable(object):
|
||||
"""
|
||||
|
@ -176,7 +176,7 @@ class Headers(MultiDict):
|
||||
self.fields = fields
|
||||
return replacements
|
||||
|
||||
|
||||
|
||||
def parse_content_type(c):
|
||||
"""
|
||||
A simple parser for content-type values. Returns a (type, subtype,
|
||||
|
@ -3,6 +3,7 @@ from six.moves import urllib
|
||||
|
||||
from .. import utils
|
||||
|
||||
|
||||
# PY2 workaround
|
||||
def decode_parse_result(result, enc):
|
||||
if hasattr(result, "decode"):
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
@ -1,6 +1,7 @@
|
||||
from netlib.http import Headers
|
||||
from netlib.http import multipart
|
||||
|
||||
|
||||
def test_decode():
|
||||
boundary = 'somefancyboundary'
|
||||
headers = Headers(
|
||||
|
@ -1,6 +1,7 @@
|
||||
from netlib import tutils
|
||||
from netlib.http import url
|
||||
|
||||
|
||||
def test_parse():
|
||||
with tutils.raises(ValueError):
|
||||
url.parse("")
|
||||
|
@ -1,5 +1,6 @@
|
||||
from netlib import basetypes
|
||||
|
||||
|
||||
class SerializableDummy(basetypes.Serializable):
|
||||
def __init__(self, i):
|
||||
self.i = i
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user