mercurial/httpclient/tests/util.py
changeset 14376 a75e0f4ba0ab
parent 14341 5c3de67e7402
child 14990 494b26ad8736
--- a/mercurial/httpclient/tests/util.py	Mon May 16 16:59:45 2011 -0500
+++ b/mercurial/httpclient/tests/util.py	Tue May 17 10:28:03 2011 -0500
@@ -88,7 +88,7 @@
     def ready_for_read(self):
         return ((self.early_data and http._END_HEADERS in self.sent)
                 or (self.read_wait_sentinel in self.sent and self.data)
-                or self.closed)
+                or self.closed or self.remote_closed)
 
     def send(self, data):
         # this is a horrible mock, but nothing needs us to raise the
@@ -117,6 +117,11 @@
     def __getattr__(self, key):
         return getattr(self._sock, key)
 
+    def __setattr__(self, key, value):
+        if key not in ('_sock', '_fail_recv'):
+            return setattr(self._sock, key, value)
+        return object.__setattr__(self, key, value)
+
     def recv(self, amt=-1):
         try:
             if self._fail_recv: