'When a connection is lost the ``ControlAMP`` is removed from the
service\'s set of connections.'

def test_connection_lost(self):

    marker = object()
    self.control_amp_service._connections.add(marker)
    self.patch(self.protocol, 'callRemote', (lambda *args, **kwargs: succeed(None)))
    self.protocol.makeConnection(StringTransportWithAbort())
    self.protocol.connectionLost(Failure(ConnectionLost()))
    self.assertEqual(self.control_amp_service._connections, {marker})
