'Check if defaults were set.'

@patch('homeassistant.components.sensor.tcp.TcpSensor.update')
def test_config_uses_defaults(self, mock_update):

    config = copy(TEST_CONFIG['sensor'])
    for key in KEYS_AND_DEFAULTS:
        del config[key]
    with assert_setup_component(1) as result_config:
        assert setup_component(self.hass, 'sensor', {'sensor': config})
    sensor = tcp.TcpSensor(self.hass, result_config['sensor'][0])
    for (key, default) in KEYS_AND_DEFAULTS.items():
        assert (sensor._config[key] == default)
