code: def test_ExtractedArchive(path=None):
      archive = op.join(path, fn_archive_obscure_ext)
      earchive = ExtractedArchive(archive)
      assert_false(op.exists(earchive.path))
      # no longer the case -- just using hash for now
      # assert_in(os.path.basename(archive), earchive.path)
  
      fpath = op.join(
          fn_archive_obscure, fn_in_archive_obscure  # lead directory
      )
      extracted = earchive.get_extracted_filename(fpath)
      eq_(extracted, op.join(earchive.path, fpath))
      assert_false(op.exists(extracted))  # not yet
  
      extracted_ = earchive.get_extracted_file(fpath)
      eq_(extracted, extracted_)
      assert_true(op.exists(extracted))  # now it should
  
      extracted_files = earchive.get_extracted_files()
      ok_generator(extracted_files)
      try:
          eq_(
              sorted(extracted_files),
              sorted(
                  [
                      # ['bbc/3.txt', 'bbc/abc']
                      op.join(
                          fn_archive_obscure, fn_in_archive_obscure
                      ),
                      op.join(fn_archive_obscure, "3.txt"),
                  ]
              ),
          )
      except AssertionError:
          if "nfsmount" in fpath:
              pytest.xfail(
                  "Archive was created before NFS startede to behave. "
                  "https://github.com/datalad/datalad/issues/4101"
              )
          raise
  
      earchive.clean()
      if not dl_cfg.get("datalad.tests.temp.keep"):
          assert_false(op.exists(earchive.path))
  
imports: import itertools
  import os
  from unittest.mock import patch
  import pytest
  from datalad import cfg
  from datalad.support import path
  from datalad.support.archive_utils_patool import unixify_path
  from datalad.support.archives import ArchivesCache, ExtractedArchive, compress_files, decompress_file
  from datalad.support.exceptions import MissingExternalDependency
  from datalad.support.external_versions import external_versions
  from datalad.tests.utils_pytest import OBSCURE_FILENAME, SkipTest, assert_false, assert_raises, assert_true, eq_, ok_file_has_content, ok_generator, on_nfs, on_travis, on_windows, skip_if, swallow_outputs, with_tempfile, with_tree
  import mimetypes
label_desc: Use image node_id 8 for calling a global function with example usage: test_ExtractedArchive(path) without return types