@@ -0,0 +1,875 @@
+from cheroot import makefile%0A%0A%0A__metaclass__ = type%0A%0A%0Aclass MockSocket:%0A    def __init__(self):%0A        self.messages = %5B%5D%0A%0A    def recv_into(self, buf):%0A        if not self.messages:%0A            return 0%0A        msg = self.messages.pop(0)%0A        for index, byte in enumerate(msg):%0A            buf%5Bindex%5D = byte%0A        return len(msg)%0A%0A    def recv(self, size):%0A        try:%0A            return self.messages.pop(0)%0A        except IndexError:%0A            return ''%0A%0A    def send(self, val):%0A        return len(val)%0A%0A%0Adef test_bytes_read():%0A    sock = MockSocket()%0A    sock.messages.append(b'foo')%0A    rfile = makefile.MakeFile(sock, 'r')%0A    rfile.read()%0A    assert rfile.bytes_read == 3%0A%0A%0Adef test_bytes_written():%0A    sock = MockSocket()%0A    sock.messages.append(b'foo')%0A    wfile = makefile.MakeFile(sock, 'w')%0A    wfile.write(b'bar')%0A    assert wfile.bytes_written == 3%0A

Add test_makefile with a couple of tests capturing the expectation that the MakeFile result has 'bytes_read' and 'bytes_written' properties. Ref #99.