From 13aaa88f6baf0b1b4b17ca3f564e0cdded38b411 Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Wed, 12 Aug 2015 15:17:27 +0530 Subject: [PATCH] test_get_pathinfo: testdir is unnecessary Use basedir itself, instead of creating another directory inside basedir. --- src/allmydata/test/test_util.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/allmydata/test/test_util.py b/src/allmydata/test/test_util.py index c3fcc65c..b34d12b0 100644 --- a/src/allmydata/test/test_util.py +++ b/src/allmydata/test/test_util.py @@ -637,19 +637,18 @@ class FileUtil(ReallyEqualMixin, unittest.TestCase): def test_get_pathinfo(self): basedir = "util/FileUtil/test_get_pathinfo" fileutil.make_dirs(basedir) - testdir = os.path.join(basedir, "foobar") # create a directory - self.mkdir(testdir, "a") - dirinfo = fileutil.get_pathinfo(testdir) + self.mkdir(basedir, "a") + dirinfo = fileutil.get_pathinfo(basedir) self.failUnlessTrue(dirinfo.isdir) self.failUnlessTrue(dirinfo.exists) self.failUnlessFalse(dirinfo.isfile) self.failUnlessFalse(dirinfo.islink) # create a file under the directory - f = os.path.join(testdir, "a/1.txt") - self.touch(testdir, "a/1.txt", data="a"*10) + f = os.path.join(basedir, "a/1.txt") + self.touch(basedir, "a/1.txt", data="a"*10) fileinfo = fileutil.get_pathinfo(f) self.failUnlessTrue(fileinfo.isfile) self.failUnlessTrue(fileinfo.exists) @@ -658,7 +657,7 @@ class FileUtil(ReallyEqualMixin, unittest.TestCase): self.failUnlessEqual(fileinfo.size, 10) # create a symlink under the directory a pointing to 1.txt - slname = os.path.join(testdir, "a/linkto1.txt") + slname = os.path.join(basedir, "a/linkto1.txt") os.symlink(f, slname) symlinkinfo = fileutil.get_pathinfo(slname) self.failUnlessTrue(symlinkinfo.islink) -- 2.45.2