diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-27 00:49:41 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-27 00:49:41 +0200 |
commit | 23d13e4c1282bc46c54222479c3b83032dad3335 (patch) | |
tree | 051bbe79f815cbdb7b8d2d76ceb0e1e4a31e4dbd /netlib/http/response.py | |
parent | 466888b01a361e46fb3d4e66afa2c6a0fd168c8e (diff) | |
download | mitmproxy-23d13e4c1282bc46c54222479c3b83032dad3335.tar.gz mitmproxy-23d13e4c1282bc46c54222479c3b83032dad3335.tar.bz2 mitmproxy-23d13e4c1282bc46c54222479c3b83032dad3335.zip |
test response model, push coverage to 100% branch cov
Diffstat (limited to 'netlib/http/response.py')
-rw-r--r-- | netlib/http/response.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/netlib/http/response.py b/netlib/http/response.py index db31d2b9..66e5ded6 100644 --- a/netlib/http/response.py +++ b/netlib/http/response.py @@ -4,12 +4,12 @@ import warnings from . import cookies from .headers import Headers -from .message import Message, _native, _always_bytes +from .message import Message, _native, _always_bytes, MessageData from .. import utils from ..odict import ODict -class ResponseData(object): +class ResponseData(MessageData): def __init__(self, http_version, status_code, reason=None, headers=None, content=None, timestamp_start=None, timestamp_end=None): if not headers: @@ -24,14 +24,6 @@ class ResponseData(object): self.timestamp_start = timestamp_start self.timestamp_end = timestamp_end - def __eq__(self, other): - if isinstance(other, ResponseData): - return self.__dict__ == other.__dict__ - return False - - def __ne__(self, other): - return not self.__eq__(other) - class Response(Message): """ @@ -48,7 +40,7 @@ class Response(Message): utils.pretty_size(len(self.content)) ) else: - details = "content missing" + details = "no content" return "Response({status_code} {reason}, {details})".format( status_code=self.status_code, reason=self.reason, |