def test_getPacketBoth(self):
        """
        Test that compressed and encrypted packets are retrieved correctly.
        See test_sendPacketBoth.
        """
        proto = MockTransportBase()
        proto.sendKexInit = lambda: None
        proto.makeConnection(self.transport)
        self.transport.clear()
        proto.currentEncryptions = MockCipher()
        proto.outgoingCompression = MockCompression()
        proto.incomingCompression = proto.outgoingCompression
        proto.sendPacket(ord('A'), b'BCDEFG')
        proto.buf = self.transport.value()
        self.assertEqual(proto.getPacket(), b'ABCDEFG')

        Test that compressed and encrypted packets are retrieved correctly.
        See test_sendPacketBoth.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_transport.py