class_docstr: Test the on-the-fly decompression.
class_docstr_tok: ["Test","the","on-the-fly","decompression","."]
docstr: Test running the xrit decompress command.
docstr_tok: ["Test","running","the","xrit","decompress","command","."]
code: def test_xrit_cmd(self):
      """Test running the xrit decompress command."""
      old_env = os.environ.get("XRIT_DECOMPRESS_PATH", None)
  
      os.environ["XRIT_DECOMPRESS_PATH"] = "/path/to/my/bin"
      with pytest.raises(IOError, match=".* does not exist!"):
          get_xritdecompress_cmd()
  
      os.environ["XRIT_DECOMPRESS_PATH"] = gettempdir()
      with pytest.raises(IOError, match=".* is a directory!.*"):
          get_xritdecompress_cmd()
  
      with NamedTemporaryFile() as fd:
          os.environ["XRIT_DECOMPRESS_PATH"] = fd.name
          fname = fd.name
          res = get_xritdecompress_cmd()
  
      if old_env is not None:
          os.environ["XRIT_DECOMPRESS_PATH"] = old_env
      else:
          os.environ.pop("XRIT_DECOMPRESS_PATH")
  
      assert fname == res
  
imports: import bz2
  import gzip
  import os
  import unittest
  from datetime import datetime, timedelta
  from tempfile import NamedTemporaryFile, gettempdir
  from unittest import mock
  import numpy
  import pytest
  from satpy.readers import FSFile
  from satpy.readers.hrit_base import HRITFileHandler, decompress, get_xritdecompress_cmd, get_xritdecompress_outfile
label_desc: Use image node_id 1 for calling the TestHRITDecompress obj's underlying member method code with example usage: obj.test_xrit_cmd() without return types