mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-12 14:05:24 +00:00
test_stringutils.py: Skip test test_listdir_unicode_good if filesystem supports only ASCII filenames
This commit is contained in:
parent
01da7f06e6
commit
0eb4d83937
@ -405,11 +405,19 @@ class CLI(unittest.TestCase):
|
|||||||
self.failUnlessRaises(common.UnknownAliasError, ga5, "C:\\Windows")
|
self.failUnlessRaises(common.UnknownAliasError, ga5, "C:\\Windows")
|
||||||
|
|
||||||
def test_listdir_unicode_good(self):
|
def test_listdir_unicode_good(self):
|
||||||
|
files = (u'Lôzane', u'Bern', u'Genève')
|
||||||
|
enc = sys.getfilesystemencoding() or 'ascii'
|
||||||
|
|
||||||
|
# Ensure that our test filenames can actually be represented by the
|
||||||
|
# current filesystem encoding
|
||||||
|
try:
|
||||||
|
[f.encode(enc) for f in files]
|
||||||
|
except UnicodeEncodeError:
|
||||||
|
raise unittest.SkipTest("Cannot represent non-ASCII filenames on this filesystem")
|
||||||
|
|
||||||
basedir = u"cli/common/listdir_unicode_good"
|
basedir = u"cli/common/listdir_unicode_good"
|
||||||
fileutil.make_dirs(basedir)
|
fileutil.make_dirs(basedir)
|
||||||
|
|
||||||
files = (u'Lôzane', u'Bern', u'Genève')
|
|
||||||
|
|
||||||
for file in files:
|
for file in files:
|
||||||
open(os.path.join(basedir, file), "w").close()
|
open(os.path.join(basedir, file), "w").close()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user