'If the other side has already closed its connection,
loseWriteConnection should pass silently.'

def testShutdownException(self):

    self.f.protocol.transport.loseConnection()
    self.client.transport.write('X')
    self.client.transport.loseWriteConnection()
    self.f.protocol.closedDeferred = d = defer.Deferred()
    self.client.closedDeferred = d2 = defer.Deferred()
    d.addCallback((lambda x: self.assertTrue(self.f.protocol.closed)))
    return defer.gatherResults([d, d2])
