code: def test_poke(self, mock_imap_hook, has_attachment_return_value):
      mock_imap_hook.return_value.__enter__ = Mock(
          return_value=mock_imap_hook
      )
      mock_imap_hook.has_mail_attachment.return_value = (
          has_attachment_return_value
      )
  
      has_attachment = ImapAttachmentSensor(**self.kwargs).poke(
          context={}
      )
  
      assert (
          has_attachment
          == mock_imap_hook.has_mail_attachment.return_value
      )
      mock_imap_hook.has_mail_attachment.assert_called_once_with(
          name=self.kwargs["attachment_name"],
          check_regex=self.kwargs["check_regex"],
          mail_folder=self.kwargs["mail_folder"],
          mail_filter=self.kwargs["mail_filter"],
      )
  
imports: from __future__ import annotations
  from unittest.mock import Mock, patch
  import pytest
  from airflow.providers.imap.sensors.imap_attachment import ImapAttachmentSensor
label_desc: Use image node_id 2 for calling the TestImapAttachmentSensor obj's underlying member method code with example usage: obj.test_poke(mock_imap_hook, has_attachment_return_value) without return types