code: def test_LongitudeFormatter_minutes_seconds(
      test_ticks, direction_label, expected
  ):
      formatter = LongitudeFormatter(
          dms=True, auto_hide=True, direction_label=direction_label
      )
      formatter.set_locs(test_ticks)
      result = [formatter(tick) for tick in test_ticks]
      prefix = "" if direction_label else "-"
      suffix = "W" if direction_label else ""
      expected = [
          f"{prefix}{text[:-1]}{suffix}" if text[-1] == "W" else text
          for text in expected
      ]
      assert result == expected
  
imports: from unittest.mock import Mock
  import matplotlib.pyplot
  import numpy
  import pytest
  import cartopy.crs
  from cartopy.mpl.geoaxes import GeoAxes
  from cartopy.mpl.ticker import LatitudeFormatter, LatitudeLocator, LongitudeFormatter, LongitudeLocator
label_desc: Use image node_id 14 for calling a global function with example usage: test_LongitudeFormatter_minutes_seconds(test_ticks, direction_label, expected) without return types