Mercurial > public > mercurial-scm > hg
diff mercurial/httpclient/tests/util.py @ 16774:69af967b6d6f
httpclient: update to c5abd358e543 of httpplus
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 18 May 2012 17:05:17 -0500 |
parents | 24dbef11f477 |
children |
line wrap: on
line diff
--- a/mercurial/httpclient/tests/util.py Mon May 21 00:20:05 2012 +0200 +++ b/mercurial/httpclient/tests/util.py Fri May 18 17:05:17 2012 -0500 @@ -58,6 +58,7 @@ self.close_on_empty = False self.sent = '' self.read_wait_sentinel = httpplus._END_HEADERS + self.blocking = True def close(self): self.closed = True @@ -66,9 +67,11 @@ self.sa = sa def setblocking(self, timeout): - assert timeout == 0 + self.blocking = bool(timeout) def recv(self, amt=-1): + # we only properly emulate non-blocking sockets + assert not self.blocking if self.early_data: datalist = self.early_data elif not self.data: @@ -136,6 +139,8 @@ ssl_version=None, ca_certs=None, do_handshake_on_connect=True, suppress_ragged_eofs=True): + assert sock.blocking, ('wrapping a socket with ssl requires that ' + 'it be in blocking mode.') return MockSSLSocket(sock)