code: def test_poke_buliding(
      self, mock_jenkins, build_number, build_state, result
  ):
      target_build_number = build_number or 10
  
      jenkins_mock = MagicMock()
      jenkins_mock.get_job_info.return_value = {
          "lastBuild": {"number": target_build_number}
      }
      jenkins_mock.get_build_info.return_value = {
          "building": build_state
      }
      mock_jenkins.return_value = jenkins_mock
  
      with patch.object(
          JenkinsHook, "get_connection"
      ) as mock_get_connection:
          mock_get_connection.return_value = MagicMock()
  
          sensor = JenkinsBuildSensor(
              dag=None,
              jenkins_connection_id="fake_jenkins_connection",
              task_id="sensor_test",
              job_name="a_job_on_jenkins",
              build_number=target_build_number,
              target_states=["SUCCESS"],
          )
  
          output = sensor.poke(None)
  
          assert output == (not build_state)
          assert (
              jenkins_mock.get_job_info.call_count == 0
              if build_number
              else 1
          )
          jenkins_mock.get_build_info.assert_called_once_with(
              "a_job_on_jenkins", target_build_number
          )
  
file_path: airflow/tests/providers/jenkins/sensors/test_jenkins.py
imports: from __future__ import annotations
  from unittest.mock import MagicMock, patch
  import pytest
  from airflow.exceptions import AirflowException, AirflowSkipException
  from airflow.providers.jenkins.hooks.jenkins import JenkinsHook
  from airflow.providers.jenkins.sensors.jenkins import JenkinsBuildSensor
label_desc: Use image node_id 1 for calling the TestJenkinsBuildSensor obj's underlying member method code with example usage: obj.test_poke_buliding(mock_jenkins, build_number, build_state, result) without return types