code: def test_tarfile_vs_tar(self):
      tmpdir, tmpdir2, base_name = self._create_files()
      old_dir = os.getcwd()
      os.chdir(tmpdir)
      try:
          make_tarball(base_name, "dist")
      finally:
          os.chdir(old_dir)
  
      # check if the compressed tarball was created
      tarball = base_name + ".tar.gz"
      self.assertTrue(os.path.exists(tarball))
  
      # now create another tarball using `tar`
      tarball2 = os.path.join(tmpdir, "archive2.tar.gz")
      tar_cmd = ["tar", "-cf", "archive2.tar", "dist"]
      gzip_cmd = ["gzip", "-f9", "archive2.tar"]
      old_dir = os.getcwd()
      os.chdir(tmpdir)
      try:
          spawn(tar_cmd)
          spawn(gzip_cmd)
      finally:
          os.chdir(old_dir)
  
      self.assertTrue(os.path.exists(tarball2))
      # let's compare both tarballs
      self.assertEqual(self._tarinfo(tarball), self._tarinfo(tarball2))
  
      # trying an uncompressed one
      base_name = os.path.join(tmpdir2, "archive")
      old_dir = os.getcwd()
      os.chdir(tmpdir)
      try:
          make_tarball(base_name, "dist", compress=None)
      finally:
          os.chdir(old_dir)
      tarball = base_name + ".tar"
      self.assertTrue(os.path.exists(tarball))
  
      # now for a dry_run
      base_name = os.path.join(tmpdir2, "archive")
      old_dir = os.getcwd()
      os.chdir(tmpdir)
      try:
          make_tarball(base_name, "dist", compress=None, dry_run=True)
      finally:
          os.chdir(old_dir)
      tarball = base_name + ".tar"
      self.assertTrue(os.path.exists(tarball))
  
imports: import unittest
  import os
  import sys
  import tarfile
  from os.path import splitdrive
  import warnings
  from distutils.archive_util import check_archive_formats, make_tarball, make_zipfile, make_archive, ARCHIVE_FORMATS
  from distutils.spawn import find_executable, spawn
  from distutils.tests import support
  from test.test_support import check_warnings, run_unittest
label_desc: Use image node_id 5 for calling the ArchiveUtilTestCase obj's underlying member method code with example usage: obj.test_tarfile_vs_tar() without return types