Fix test to use arguments with absolute unicode paths

This commit is contained in:
Daira Hopwood 2016-02-15 15:29:29 +00:00 committed by Brian Warner
parent 3524729fb1
commit 242f04818e

View File

@ -568,9 +568,10 @@ class FileUtil(ReallyEqualMixin, unittest.TestCase):
os.chdir(saved_cwd)
def test_make_dirs_with_absolute_mode(self):
workdir = u"test_make_dirs_with_absolute_mode"
workdir = fileutil.abspath_expanduser_unicode(u"test_make_dirs_with_absolute_mode")
fileutil.make_dirs(workdir)
fileutil.make_dirs_with_absolute_mode(workdir, os.path.join(workdir,"a/b/c/d"), 0766)
abspath = fileutil.abspath_expanduser_unicode(u"a/b/c/d", base=workdir)
fileutil.make_dirs_with_absolute_mode(workdir, abspath, 0766)
new_mode = os.stat(os.path.join(workdir,"a/b/c/d")).st_mode & 0777
self.failUnlessEqual(new_mode, 0766)
new_mode = os.stat(os.path.join(workdir,"a/b/c")).st_mode & 0777