From d864a326d25815a240aa5ac34171e48687311f29 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 5 Feb 2014 14:33:17 +0100 Subject: fix all tests except those using set_url and get_url --- libmproxy/protocol/http.py | 5 ++--- libmproxy/protocol/primitives.py | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'libmproxy/protocol') diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index be60f374..636e1b07 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -56,7 +56,7 @@ class decoded(object): class HTTPMessage(stateobject.SimpleStateObject): def __init__(self): - self.flow = None # Will usually set by backref mixin + self.flow = None # will usually be set by the flow backref mixin """@type: HTTPFlow""" def get_decoded_content(self): @@ -197,7 +197,7 @@ class HTTPRequest(HTTPMessage): timestamp_end: Timestamp indicating when request transmission ended """ def __init__(self, form_in, method, scheme, host, port, path, httpversion, headers, content, - timestamp_start, timestamp_end, form_out=None): + timestamp_start=None, timestamp_end=None, form_out=None): assert isinstance(headers, ODictCaseless) or not headers HTTPMessage.__init__(self) @@ -758,7 +758,6 @@ class HTTPFlow(Flow): """ Continue with the flow - called after an intercept(). """ - assert self.intercepting if self.request: if not self.request.reply.acked: self.request.reply() diff --git a/libmproxy/protocol/primitives.py b/libmproxy/protocol/primitives.py index f77e097b..f3fdd245 100644 --- a/libmproxy/protocol/primitives.py +++ b/libmproxy/protocol/primitives.py @@ -41,6 +41,7 @@ class Error(stateobject.SimpleStateObject): @type msg: str @type timestamp: float """ + self.flow = None # will usually be set by the flow backref mixin self.msg = msg self.timestamp = timestamp or utils.timestamp() @@ -88,6 +89,9 @@ class Flow(stateobject.SimpleStateObject, _BackreferenceMixin): f._load_state(state) return f + def __eq__(self, other): + return self is other + def copy(self): f = copy.copy(self) -- cgit v1.2.3