parent
ab7e80085a
commit
ec68d8b8e4
|
@ -47,7 +47,7 @@ class Script(object):
|
|||
if os.name == "nt": # pragma: no cover
|
||||
backslashes = shlex.split(command, posix=False)[0].count("\\")
|
||||
command = command.replace("\\", "\\\\", backslashes)
|
||||
args = shlex.split(command) # pragma: nocover
|
||||
args = shlex.split(command) # pragma: no cover
|
||||
args[0] = os.path.expanduser(args[0])
|
||||
if not os.path.exists(args[0]):
|
||||
raise ScriptException(
|
||||
|
|
|
@ -140,7 +140,7 @@ class AuthAction(Action):
|
|||
authenticator = BasicProxyAuth(passman, "mitmproxy")
|
||||
setattr(namespace, self.dest, authenticator)
|
||||
|
||||
def getPasswordManager(self, s): # pragma: nocover
|
||||
def getPasswordManager(self, s): # pragma: no cover
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from __future__ import absolute_import, print_function, division
|
|||
import copy
|
||||
try:
|
||||
from collections.abc import MutableMapping
|
||||
except ImportError: # pragma: nocover
|
||||
except ImportError: # pragma: no cover
|
||||
from collections import MutableMapping # Workaround for Python < 3.3
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@ import six
|
|||
|
||||
from netlib.utils import always_byte_args, always_bytes, Serializable
|
||||
|
||||
if six.PY2: # pragma: nocover
|
||||
if six.PY2: # pragma: no cover
|
||||
_native = lambda x: x
|
||||
_always_bytes = lambda x: x
|
||||
_always_byte_args = lambda x: x
|
||||
|
@ -106,7 +106,7 @@ class Headers(MutableMapping, Serializable):
|
|||
else:
|
||||
return b""
|
||||
|
||||
if six.PY2: # pragma: nocover
|
||||
if six.PY2: # pragma: no cover
|
||||
__str__ = __bytes__
|
||||
|
||||
@_always_byte_args
|
||||
|
|
|
@ -7,7 +7,7 @@ import six
|
|||
from .headers import Headers
|
||||
from .. import encoding, utils
|
||||
|
||||
if six.PY2: # pragma: nocover
|
||||
if six.PY2: # pragma: no cover
|
||||
_native = lambda x: x
|
||||
_always_bytes = lambda x: x
|
||||
else:
|
||||
|
@ -180,12 +180,12 @@ class Message(utils.Serializable):
|
|||
# Legacy
|
||||
|
||||
@property
|
||||
def body(self): # pragma: nocover
|
||||
def body(self): # pragma: no cover
|
||||
warnings.warn(".body is deprecated, use .content instead.", DeprecationWarning)
|
||||
return self.content
|
||||
|
||||
@body.setter
|
||||
def body(self, body): # pragma: nocover
|
||||
def body(self, body): # pragma: no cover
|
||||
warnings.warn(".body is deprecated, use .content instead.", DeprecationWarning)
|
||||
self.content = body
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ class Request(Message):
|
|||
Setting the host attribute also updates the host header, if present.
|
||||
"""
|
||||
|
||||
if six.PY2: # pragma: nocover
|
||||
if six.PY2: # pragma: no cover
|
||||
return self.data.host
|
||||
|
||||
if not self.data.host:
|
||||
|
@ -324,59 +324,59 @@ class Request(Message):
|
|||
|
||||
# Legacy
|
||||
|
||||
def get_cookies(self): # pragma: nocover
|
||||
def get_cookies(self): # pragma: no cover
|
||||
warnings.warn(".get_cookies is deprecated, use .cookies instead.", DeprecationWarning)
|
||||
return self.cookies
|
||||
|
||||
def set_cookies(self, odict): # pragma: nocover
|
||||
def set_cookies(self, odict): # pragma: no cover
|
||||
warnings.warn(".set_cookies is deprecated, use .cookies instead.", DeprecationWarning)
|
||||
self.cookies = odict
|
||||
|
||||
def get_query(self): # pragma: nocover
|
||||
def get_query(self): # pragma: no cover
|
||||
warnings.warn(".get_query is deprecated, use .query instead.", DeprecationWarning)
|
||||
return self.query or ODict([])
|
||||
|
||||
def set_query(self, odict): # pragma: nocover
|
||||
def set_query(self, odict): # pragma: no cover
|
||||
warnings.warn(".set_query is deprecated, use .query instead.", DeprecationWarning)
|
||||
self.query = odict
|
||||
|
||||
def get_path_components(self): # pragma: nocover
|
||||
def get_path_components(self): # pragma: no cover
|
||||
warnings.warn(".get_path_components is deprecated, use .path_components instead.", DeprecationWarning)
|
||||
return self.path_components
|
||||
|
||||
def set_path_components(self, lst): # pragma: nocover
|
||||
def set_path_components(self, lst): # pragma: no cover
|
||||
warnings.warn(".set_path_components is deprecated, use .path_components instead.", DeprecationWarning)
|
||||
self.path_components = lst
|
||||
|
||||
def get_form_urlencoded(self): # pragma: nocover
|
||||
def get_form_urlencoded(self): # pragma: no cover
|
||||
warnings.warn(".get_form_urlencoded is deprecated, use .urlencoded_form instead.", DeprecationWarning)
|
||||
return self.urlencoded_form or ODict([])
|
||||
|
||||
def set_form_urlencoded(self, odict): # pragma: nocover
|
||||
def set_form_urlencoded(self, odict): # pragma: no cover
|
||||
warnings.warn(".set_form_urlencoded is deprecated, use .urlencoded_form instead.", DeprecationWarning)
|
||||
self.urlencoded_form = odict
|
||||
|
||||
def get_form_multipart(self): # pragma: nocover
|
||||
def get_form_multipart(self): # pragma: no cover
|
||||
warnings.warn(".get_form_multipart is deprecated, use .multipart_form instead.", DeprecationWarning)
|
||||
return self.multipart_form or ODict([])
|
||||
|
||||
@property
|
||||
def form_in(self): # pragma: nocover
|
||||
def form_in(self): # pragma: no cover
|
||||
warnings.warn(".form_in is deprecated, use .first_line_format instead.", DeprecationWarning)
|
||||
return self.first_line_format
|
||||
|
||||
@form_in.setter
|
||||
def form_in(self, form_in): # pragma: nocover
|
||||
def form_in(self, form_in): # pragma: no cover
|
||||
warnings.warn(".form_in is deprecated, use .first_line_format instead.", DeprecationWarning)
|
||||
self.first_line_format = form_in
|
||||
|
||||
@property
|
||||
def form_out(self): # pragma: nocover
|
||||
def form_out(self): # pragma: no cover
|
||||
warnings.warn(".form_out is deprecated, use .first_line_format instead.", DeprecationWarning)
|
||||
return self.first_line_format
|
||||
|
||||
@form_out.setter
|
||||
def form_out(self, form_out): # pragma: nocover
|
||||
def form_out(self, form_out): # pragma: no cover
|
||||
warnings.warn(".form_out is deprecated, use .first_line_format instead.", DeprecationWarning)
|
||||
self.first_line_format = form_out
|
||||
|
||||
|
|
|
@ -97,20 +97,20 @@ class Response(Message):
|
|||
|
||||
# Legacy
|
||||
|
||||
def get_cookies(self): # pragma: nocover
|
||||
def get_cookies(self): # pragma: no cover
|
||||
warnings.warn(".get_cookies is deprecated, use .cookies instead.", DeprecationWarning)
|
||||
return self.cookies
|
||||
|
||||
def set_cookies(self, odict): # pragma: nocover
|
||||
def set_cookies(self, odict): # pragma: no cover
|
||||
warnings.warn(".set_cookies is deprecated, use .cookies instead.", DeprecationWarning)
|
||||
self.cookies = odict
|
||||
|
||||
@property
|
||||
def msg(self): # pragma: nocover
|
||||
def msg(self): # pragma: no cover
|
||||
warnings.warn(".msg is deprecated, use .reason instead.", DeprecationWarning)
|
||||
return self.reason
|
||||
|
||||
@msg.setter
|
||||
def msg(self, reason): # pragma: nocover
|
||||
def msg(self, reason): # pragma: no cover
|
||||
warnings.warn(".msg is deprecated, use .reason instead.", DeprecationWarning)
|
||||
self.reason = reason
|
||||
|
|
|
@ -208,7 +208,7 @@ class Pathoc(tcp.TCPClient):
|
|||
self.ws_framereader = None
|
||||
|
||||
if self.use_http2:
|
||||
if not tcp.HAS_ALPN: # pragma: nocover
|
||||
if not tcp.HAS_ALPN: # pragma: no cover
|
||||
log.write_raw(
|
||||
self.fp,
|
||||
"HTTP/2 requires ALPN support. "
|
||||
|
@ -458,7 +458,7 @@ class Pathoc(tcp.TCPClient):
|
|||
# TODO: do something
|
||||
|
||||
|
||||
def main(args): # pragma: nocover
|
||||
def main(args): # pragma: no cover
|
||||
memo = set([])
|
||||
trycount = 0
|
||||
p = None
|
||||
|
|
|
@ -221,6 +221,6 @@ def args_pathoc(argv, stdout=sys.stdout, stderr=sys.stderr):
|
|||
return args
|
||||
|
||||
|
||||
def go_pathoc(): # pragma: nocover
|
||||
def go_pathoc(): # pragma: no cover
|
||||
args = args_pathoc(sys.argv)
|
||||
pathoc.main(args)
|
||||
|
|
|
@ -430,7 +430,7 @@ class Pathod(tcp.TCPServer):
|
|||
return self.log
|
||||
|
||||
|
||||
def main(args): # pragma: nocover
|
||||
def main(args): # pragma: no cover
|
||||
ssloptions = SSLOptions(
|
||||
cn=args.cn,
|
||||
confdir=args.confdir,
|
||||
|
|
|
@ -226,6 +226,6 @@ def args_pathod(argv, stdout_=sys.stdout, stderr_=sys.stderr):
|
|||
return args
|
||||
|
||||
|
||||
def go_pathod(): # pragma: nocover
|
||||
def go_pathod(): # pragma: no cover
|
||||
args = args_pathod(sys.argv)
|
||||
pathod.main(args)
|
||||
|
|
|
@ -98,7 +98,7 @@ class Data(object):
|
|||
data = Data(__name__)
|
||||
|
||||
|
||||
def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): # pragma: nocover
|
||||
def daemonize(stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): # pragma: no cover
|
||||
try:
|
||||
pid = os.fork()
|
||||
if pid > 0:
|
||||
|
|
Loading…
Reference in New Issue