def test_unimplementedPackets(self):
        """
        Test that unimplemented packet types cause MSG_UNIMPLEMENTED packets
        to be sent.
        """
        seqnum = self.proto.incomingPacketSequence
        def checkUnimplemented(seqnum=seqnum):
            self.assertEqual(self.packets[0][0],
                             transport.MSG_UNIMPLEMENTED)
            self.assertEqual(self.packets[0][1][3:4], chr(seqnum))
            self.proto.packets = []
            seqnum += 1

        self.proto.dispatchMessage(40, b'')
        checkUnimplemented()
        transport.messages[41] = b'MSG_fiction'
        self.proto.dispatchMessage(41, b'')
        checkUnimplemented()
        self.proto.dispatchMessage(60, b'')
        checkUnimplemented()
        self.proto.setService(MockService())
        self.proto.dispatchMessage(70, b'')
        checkUnimplemented()
        self.proto.dispatchMessage(71, b'')
        checkUnimplemented()

        Test that unimplemented packet types cause MSG_UNIMPLEMENTED packets
        to be sent.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_transport.py