def test_synchronousFetch(self):
        """
        Test that pipelined FETCH commands which can be responded to
        synchronously are responded to correctly.
        """
        # Here's some pipelined stuff
        self.server.dataReceived(
            b'01 FETCH 1 BODY[]\r\n'
            b'02 FETCH 2 BODY[]\r\n'
            b'03 FETCH 3 BODY[]\r\n')

        self.flushPending()

        self.assertEqual(
            self.transport.value(), b''.join([
                b'* 1 FETCH (BODY[] )\r\n',
                networkString(
                    '01 OK FETCH completed\r\n{5}\r\n\r\n\r\n%s' % (
                        nativeString(self.messages[0].getBodyFile().read()),
                    )
                ),
                b'* 2 FETCH (BODY[] )\r\n',
                networkString(
                    '02 OK FETCH completed\r\n{5}\r\n\r\n\r\n%s' % (
                        nativeString(self.messages[1].getBodyFile().read()),
                    )
                ),
                b'* 3 FETCH (BODY[] )\r\n',
                networkString(
                    '03 OK FETCH completed\r\n{5}\r\n\r\n\r\n%s' % (
                        nativeString(self.messages[2].getBodyFile().read()),
                    )
                ),
            ]))

        Test that pipelined FETCH commands which can be responded to
        synchronously are responded to correctly.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_imap.py