'Check a valid configuration and call add_devices with sensor.'

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

    with assert_setup_component(0, 'sensor'):
        assert setup_component(self.hass, 'sensor', TEST_CONFIG)
    add_devices = Mock()
    tcp.setup_platform(None, TEST_CONFIG['sensor'], add_devices)
    assert add_devices.called
    assert isinstance(add_devices.call_args[0][0][0], tcp.TcpSensor)
