From 0616aa7de7a991f25c4c8c07c3763311128ccc35 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 28 Mar 2018 15:17:23 -0700 Subject: [PATCH] test_absolute_storage_dir: don't use uSNOWMAN on non-unicode platforms Exercising the unicode possibilities are nice, but not critical to this test, so let's just avoid the non-ascii characters when the filesystem encoding can't handle them --- src/allmydata/test/test_client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/allmydata/test/test_client.py b/src/allmydata/test/test_client.py index d2c701d1e..cf1d92b7b 100644 --- a/src/allmydata/test/test_client.py +++ b/src/allmydata/test/test_client.py @@ -11,7 +11,7 @@ from allmydata.node import OldConfigError, OldConfigOptionError, UnescapedHashEr from allmydata.frontends.auth import NeedRootcapLookupScheme from allmydata import client from allmydata.storage_client import StorageFarmBroker -from allmydata.util import base32, fileutil +from allmydata.util import base32, fileutil, encodingutil from allmydata.util.fileutil import abspath_expanduser_unicode from allmydata.interfaces import IFilesystemNode, IFileNode, \ IImmutableFileNode, IMutableFileNode, IDirectoryNode @@ -320,8 +320,11 @@ class Basic(testutil.ReallyEqualMixin, testutil.NonASCIIPathMixin, unittest.Test # don't want a literal absolute path like /myowndir which we won't # have write permission to. So construct an absolute path that we # should be able to write to. + base = u"\N{SNOWMAN}" + if encodingutil.filesystem_encoding != "utf-8": + base = u"melted_snowman" expected_path = abspath_expanduser_unicode( - u"client.Basic.test_absolute_storage_dir_myowndir/\N{SNOWMAN}" + u"client.Basic.test_absolute_storage_dir_myowndir/" + base ) config_path = expected_path.encode("utf-8") self._storage_dir_test(