class_docstr: Tests for 'get_satpos'.
class_docstr_tok: ["Tests","for","'get_satpos","'","."]
docstr: Test getting satellite position from satellite name only.
docstr_tok: ["Test","getting","satellite","position","from","satellite","name","only","."]
code: def test_get_satpos_from_satname(self, caplog):
      """Test getting satellite position from satellite name only."""
      import pyorbital.tlefile
  
      data_arr = xr.DataArray(
          (),
          attrs={
              "platform_name": "Meteosat-42",
              "sensor": "irives",
              "start_time": datetime.datetime(2031, 11, 20, 19, 18, 17),
          },
      )
      with mock.patch("pyorbital.tlefile.read") as plr:
          plr.return_value = pyorbital.tlefile.Tle(
              "Meteosat-42",
              line1="1 40732U 15034A   22011.84285506  .00000004  00000+0  00000+0 0  9995",
              line2="2 40732   0.2533 325.0106 0000976 118.8734 330.4058  1.00272123 23817",
          )
          with caplog.at_level(logging.WARNING):
              (lon, lat, alt) = get_satpos(data_arr, use_tle=True)
          assert (
              "Orbital parameters missing from metadata" in caplog.text
          )
          np.testing.assert_allclose(
              (lon, lat, alt),
              (
                  119.39533705010592,
                  -1.1491628298731498,
                  35803.19986408156,
              ),
              rtol=1e-4,
          )
  
imports: from __future__ import annotations
  import datetime
  import logging
  import typing
  import unittest
  import warnings
  from math import sqrt
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
  from satpy.tests.utils import xfail_skyfield_unstable_numpy2
  from satpy.utils import angle2xyz, get_legacy_chunk_size, get_satpos, import_error_helper, lonlat2xyz, proj_units_to_meters, xyz2angle, xyz2lonlat
label_desc: Use image node_id 3 for calling the TestGetSatPos obj's underlying member method code with example usage: obj.test_get_satpos_from_satname(caplog) without return types