'_SendmsgMixin handles multiple file descriptors per recvmsg, calling
L{IFileDescriptorReceiver.fileDescriptorReceived} once per received
file descriptor. Scenario: unsupported CMSGs.'

def test_multiFileDescriptorReceivedPerRecvmsgBadCMSG(self):

    from twisted.python import sendmsg
    def ancillaryPacker(fdsToSend):
        ancillary = []
        expectedCount = 0
        return (ancillary, expectedCount)
    def fakeRecvmsgUnsupportedAncillary(skt, *args, **kwargs):
        data = 'some    data'
        ancillary = [(None, None, '')]
        flags = 0
        return sendmsg.RecievedMessage(data, ancillary, flags)
    events = []
    addObserver(events.append)
    self.addCleanup(removeObserver, events.append)
    self.patch(sendmsg, 'recvmsg', fakeRecvmsgUnsupportedAncillary)
    self._sendmsgMixinFileDescriptorReceivedDriver(ancillaryPacker)
    expectedMessage = 'received    unsupported    ancillary    data'
    found = any(((expectedMessage in e['format']) for e in events))
    self.assertTrue(found, 'Expected    message    not    found    in    logged    events')
