def test_run_persistent_client_signal(self, run_mock):
        # Invalid client.
        self.assertFalse(run_mock.called)
        run_persistent_client.send_robust(None, client=None)
        self.assertFalse(run_mock.called)

        influxdb_client = InfluxDBClient('http://localhost:8086', '')
        self.assertFalse(run_mock.called)
        run_persistent_client.send_robust(None, client=influxdb_client)
        self.assertTrue(run_mock.called)
    def test_run_persistent_client_signal(self, run_mock):
        # Invalid client.
        self.assertFalse(run_mock.called)
        run_persistent_client.send_robust(None, client=None)
        self.assertFalse(run_mock.called)

        mqtt_client = Client()
        self.assertFalse(run_mock.called)
        run_persistent_client.send_robust(None, client=mqtt_client)
        self.assertTrue(run_mock.called)
Example #3
0
def run(clients) -> None:
    """ Asks listeners to run tasks with their client. """
    logger.debug('CLIENTS: Running %d active client(s)', len(clients))

    for current in clients:
        responses = run_persistent_client.send_robust(None, client=current)

        for _current_receiver, current_response in responses:
            if isinstance(current_response, Exception):
                logger.error('CLIENTS: Run error: %s', current_response)