'Test that unimplemented packet types cause MSG_UNIMPLEMENTED packets
to be sent.'

def test_unimplementedPackets(self):

    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, '')
    checkUnimplemented()
    transport.messages[41] = 'MSG_fiction'
    self.proto.dispatchMessage(41, '')
    checkUnimplemented()
    self.proto.dispatchMessage(60, '')
    checkUnimplemented()
    self.proto.setService(MockService())
    self.proto.dispatchMessage(70, '')
    checkUnimplemented()
    self.proto.dispatchMessage(71, '')
    checkUnimplemented()
