@mock.patch('statsd.Connection')
    @mock.patch('statsd.Gauge')
    def test_statsd_setup_defaults(self, mock_gauge, mock_connection):
        config = {
            'statsd': {
                'host': 'host',
            }
        }
        hass = mock.MagicMock()
        self.assertTrue(statsd.setup(hass, config))
        mock_connection.assert_called_once_with(
            host='host',
            port=statsd.DEFAULT_PORT,
            sample_rate=statsd.DEFAULT_RATE,
            disabled=False)
        mock_gauge.assert_called_once_with(statsd.DEFAULT_PREFIX,
                                           mock_connection.return_value)
        self.assertTrue(hass.bus.listen.called)
Test setup with defaults.
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/test_statsd.py/TestStatsd.test_statsd_setup_defaults