'Exceptions raised by the transport\'s write method should be turned into
C{Failure}s passed to errbacks of the C{Deferred} returned by
L{DNSDatagramProtocol.query}.'

def test_writeError(self):

    def writeError(message, addr):
        raise RuntimeError('bar')
    self.proto.transport.write = writeError
    d = self.proto.query(('127.0.0.1', 21345), [dns.Query('foo')])
    return self.assertFailure(d, RuntimeError)
