'Test setup with defaults.'

@mock.patch('statsd.StatsClient')
def test_statsd_setup_defaults(self, mock_connection):

    config = {'statsd': {'host': 'host'}}
    config['statsd'][statsd.CONF_PORT] = statsd.DEFAULT_PORT
    config['statsd'][statsd.CONF_PREFIX] = statsd.DEFAULT_PREFIX
    self.hass.bus.listen = mock.MagicMock()
    self.assertTrue(setup_component(self.hass, statsd.DOMAIN, config))
    self.assertEqual(mock_connection.call_count, 1)
    self.assertEqual(mock_connection.call_args, mock.call(host='host', port=8125, prefix='hass'))
    self.assertTrue(self.hass.bus.listen.called)
