def test_sendPacketCompressed(self):
        """
        Test that packets sent while compression is enabled are sent
        correctly.  The packet type and data should be encrypted.
        """
        proto = MockTransportBase()
        proto.makeConnection(self.transport)
        self.finishKeyExchange(proto)
        proto.outgoingCompression = MockCompression()
        self.transport.clear()
        proto.sendPacket(ord('A'), b'B')
        value = self.transport.value()
        self.assertEqual(
            value,
            b'\x00\x00\x00\x0c\x08BA\x66\x99\x99\x99\x99\x99\x99\x99\x99')

        Test that packets sent while compression is enabled are sent
        correctly.  The packet type and data should be encrypted.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_transport.py