def test_explicitFlush(self):
        """
        L{imap4.WriteBuffer.flush} flushes the buffer even when its
        size is smaller than the buffer size.
        """
        buf = imap4.WriteBuffer(self.transport)
        data = b'x' * (buf.bufferSize)

        buf.write(data)

        self.assertFalse(self.transport.value())

        buf.flush()

        self.assertEqual(self.transport.value(), data)

        L{imap4.WriteBuffer.flush} flushes the buffer even when its
        size is smaller than the buffer size.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_imap.py