Commits

Jason R. Coombs  committed 3c11e3f

Issue #11638: Another test to capture failure in make_tarball

  • Participants
  • Parent commits 55ef480
  • Branches 2.7

Comments (0)

Files changed (1)

File Lib/distutils/tests/test_archive_util.py

 
     @unittest.skipUnless(zlib, "requires zlib")
     def test_make_tarball(self):
+        self._make_tarball('archive')
+
+    def _make_tarball(self, target_name):
         # creating something to tar
         tmpdir = self.mkdtemp()
         self.write_file([tmpdir, 'file1'], 'xxx')
         unittest.skipUnless(splitdrive(tmpdir)[0] == splitdrive(tmpdir2)[0],
                             "source and target should be on same drive")
 
-        base_name = os.path.join(tmpdir2, 'archive')
+        base_name = os.path.join(tmpdir2, target_name)
 
         # working with relative paths to avoid tar warnings
         old_dir = os.getcwd()
         self.assertTrue(os.path.exists(tarball))
 
         # trying an uncompressed one
-        base_name = os.path.join(tmpdir2, 'archive')
+        base_name = os.path.join(tmpdir2, target_name)
         old_dir = os.getcwd()
         os.chdir(tmpdir)
         try:
         finally:
             del ARCHIVE_FORMATS['xxx']
 
+    @unittest.skipUnless(zlib, "requires zlib")
+    def test_make_tarball_unicode(self):
+        """
+        Mirror test_make_tarball, except filename is unicode.
+        """
+        self._make_tarball(u'archive')
+
 def test_suite():
     return unittest.makeSuite(ArchiveUtilTestCase)