old_contents: import glob
  import os
  import subprocess
  import tempfile
  from tests import BaseTest
  from compressor import main_engine
  
  
  def _files_identical(*files):
      """Check if the list of provided files are identical.
      returns :bool:"""
      if not files:
          raise ValueError("No files provided for comparison")
      hashes = {subprocess.check_output(['sha256sum', fn]).split()[0] for fn in files}
      return len(hashes) == 1
  
  
  class SmokeTest(BaseTest):
      """Test that a reconstructed file (a file that was decompressed from
      a previous compression process) is identical to the original."""
  
      def test_compress_and_retrieve_datasets(self):
          """Content must be unmodified, meaning the extracted file must
          match the content prior compression."""
          for source in glob.glob(os.path.join(self.store, '*.txt')):
              target = tempfile.NamedTemporaryFile().name
              # Compress
              main_engine(source, compress=True, dest_file=target)
              # Now extract
              extracted = tempfile.NamedTemporaryFile().name
              main_engine(target, extract=True, compress=False, dest_file=extracted)
              self.assertTrue(_files_identical(source, extracted), source)
  
  
  if __name__ == '__main__':
      unittest.main()
  
new_contents: import glob
  import os
  import subprocess
  import tempfile
  import hashlib
  from tests import BaseTest
  from compressor import main_engine
  
  from typing import List
  
  
  def _all_files_identical(*files: List[str]) -> bool:
      """Check if the list of provided files are identical.
      returns :bool:
      """
      hashes = set()
      for filename in files:
          with open(filename, 'rb') as fname:
              content = fname.read()
              hashed = hashlib.sha256(content).hexdigest()
              hashes.add(hashed)
      return len(hashes) == 1
  
  
  class SmokeTest(BaseTest):
      """Test that a reconstructed file (a file that was decompressed from
      a previous compression process) is identical to the original.
      """
  
      def test_compress_and_retrieve_datasets(self):
          """Content must be unmodified, meaning the extracted file must
          match the content prior compression.
          """
          for source in glob.glob(os.path.join(self.store, '*.txt')):
              target = tempfile.NamedTemporaryFile().name
              # Compress
              main_engine(source, compress=True, dest_file=target)
              # Now extract
              extracted = tempfile.NamedTemporaryFile().name
              main_engine(target, extract=True, compress=False, dest_file=extracted)
              self.assertTrue(_all_files_identical(source, extracted), source)
  
  
  if __name__ == '__main__':
      unittest.main()
  
subject: Replace subprocess in tests