code: def test_init(self):
      ec2_operator = EC2InstanceStateSensor(
          task_id="task_test",
          target_state="stopped",
          instance_id="i-123abc",
          aws_conn_id="aws_conn_test",
          region_name="region-test",
      )
      assert ec2_operator.task_id == "task_test"
      assert ec2_operator.target_state == "stopped"
      assert ec2_operator.instance_id == "i-123abc"
      assert ec2_operator.aws_conn_id == "aws_conn_test"
      assert ec2_operator.region_name == "region-test"
  
file_path: airflow/tests/providers/amazon/aws/sensors/test_ec2.py
imports: from __future__ import annotations
  import pytest
  from moto import mock_ec2
  from airflow.exceptions import TaskDeferred
  from airflow.providers.amazon.aws.hooks.ec2 import EC2Hook
  from airflow.providers.amazon.aws.sensors.ec2 import EC2InstanceStateSensor
label_desc: Use image node_id 1 for calling the TestEC2InstanceStateSensor obj's underlying member method code with example usage: obj.test_init() without return types