@patch("socket.socket")
    @patch("select.select", return_value=(True, False, False))
    def test_update_renders_value_in_template(self, mock_select, mock_socket):
        """Should render the value in the provided template."""
        test_value = "test_value"
        mock_socket = mock_socket().__enter__()
        mock_socket.recv.return_value = test_value.encode()
        config = copy(TEST_CONFIG)
        config[tcp.CONF_VALUE_TEMPLATE] = "{{ value }} {{ 1+1 }}"
        sensor = tcp.Sensor(self.hass, config)
        assert sensor._state == test_value % "%s 2"
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/sensor/test_tcp.py/TestTCPSensor.test_update_renders_value_in_template/swapped operands of `%`