Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
812d67fa
Commit
812d67fa
authored
Dec 28, 2011
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit test scope to those platforms that can save the target filenames. Reference #11638.
parent
57661611
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
tests/test_archive_util.py
tests/test_archive_util.py
+17
-0
No files found.
tests/test_archive_util.py
View file @
812d67fa
...
...
@@ -2,6 +2,7 @@
"""Tests for distutils.archive_util."""
import
unittest
import
os
import
sys
import
tarfile
from
os.path
import
splitdrive
import
warnings
...
...
@@ -26,6 +27,18 @@ try:
except
ImportError
:
ZLIB_SUPPORT
=
False
def
can_fs_encode
(
filename
):
"""
Return True if the filename can be saved in the file system.
"""
if
os
.
path
.
supports_unicode_filenames
:
return
True
try
:
filename
.
encode
(
sys
.
getfilesystemencoding
())
except
UnicodeEncodeError
:
return
False
return
True
class
ArchiveUtilTestCase
(
support
.
TempdirManager
,
support
.
LoggingSilencer
,
...
...
@@ -36,6 +49,8 @@ class ArchiveUtilTestCase(support.TempdirManager,
self
.
_make_tarball
(
'archive'
)
@
unittest
.
skipUnless
(
ZLIB_SUPPORT
,
'Need zlib support to run'
)
@
unittest
.
skipUnless
(
can_fs_encode
(
'årchiv'
),
'File system cannot handle this filename'
)
def
test_make_tarball_latin1
(
self
):
"""
Mirror test_make_tarball, except filename contains latin characters.
...
...
@@ -43,6 +58,8 @@ class ArchiveUtilTestCase(support.TempdirManager,
self
.
_make_tarball
(
'årchiv'
)
# note this isn't a real word
@
unittest
.
skipUnless
(
ZLIB_SUPPORT
,
'Need zlib support to run'
)
@
unittest
.
skipUnless
(
can_fs_encode
(
'のアーカイブ'
),
'File system cannot handle this filename'
)
def
test_make_tarball_extended
(
self
):
"""
Mirror test_make_tarball, except filename contains extended
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment