From: Daira Hopwood Date: Tue, 28 Apr 2015 18:48:49 +0000 (+0100) Subject: Fix tests :-D X-Git-Url: https://git.rkrishnan.org/components/%22news.html/frontends/using.html?a=commitdiff_plain;h=3a954504d32da373fa11100179e72647d3af536d;p=tahoe-lafs%2Ftahoe-lafs.git Fix tests :-D Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/test/test_drop_upload.py b/src/allmydata/test/test_drop_upload.py index af176781..d6207dc0 100644 --- a/src/allmydata/test/test_drop_upload.py +++ b/src/allmydata/test/test_drop_upload.py @@ -307,10 +307,14 @@ class MockTest(DropUploadTestMixin, unittest.TestCase): def test_errors(self): self.basedir = "drop_upload.MockTest.test_errors" self.set_up_grid() - errors_dir = os.path.join(self.basedir, "errors_dir") + + basedir = abspath_expanduser_unicode(unicode(self.basedir)) + errors_dir = abspath_expanduser_unicode(u"errors_dir", base=basedir) os.mkdir(errors_dir) - not_a_dir = os.path.join(self.basedir, 'NOT_A_DIR') + not_a_dir = abspath_expanduser_unicode(u"NOT_A_DIR", base=basedir) fileutil.write(not_a_dir, "") + magicfolderdb = abspath_expanduser_unicode(u"magicfolderdb", base=basedir) + doesnotexist = abspath_expanduser_unicode(u"doesnotexist", base=basedir) client = self.g.clients[0] d = client.create_dirnode() @@ -319,20 +323,16 @@ class MockTest(DropUploadTestMixin, unittest.TestCase): upload_dircap = n.get_uri() readonly_dircap = n.get_readonly_uri() - self.shouldFail(AssertionError, 'invalid local.directory', 'could not be represented', - DropUploader, client, upload_dircap, '\xFF', 'magicfolderdb', inotify=fake_inotify) self.shouldFail(AssertionError, 'nonexistent local.directory', 'there is no directory', - DropUploader, client, upload_dircap, os.path.join(self.basedir, "Laputa"), 'magicfolderdb', inotify=fake_inotify) - + DropUploader, client, upload_dircap, doesnotexist, magicfolderdb, inotify=fake_inotify) self.shouldFail(AssertionError, 'non-directory local.directory', 'is not a directory', - DropUploader, client, upload_dircap, not_a_dir, 'magicfolderdb', inotify=fake_inotify) - + DropUploader, client, upload_dircap, not_a_dir, magicfolderdb, inotify=fake_inotify) self.shouldFail(AssertionError, 'bad upload.dircap', 'does not refer to a directory', - DropUploader, client, 'bad', errors_dir, 'magicfolderdb', inotify=fake_inotify) + DropUploader, client, 'bad', errors_dir, magicfolderdb, inotify=fake_inotify) self.shouldFail(AssertionError, 'non-directory upload.dircap', 'does not refer to a directory', - DropUploader, client, 'URI:LIT:foo', errors_dir, 'magicfolderdb', inotify=fake_inotify) + DropUploader, client, 'URI:LIT:foo', errors_dir, magicfolderdb, inotify=fake_inotify) self.shouldFail(AssertionError, 'readonly upload.dircap', 'is not a writecap to a directory', - DropUploader, client, readonly_dircap, errors_dir, 'magicfolderdb', inotify=fake_inotify) + DropUploader, client, readonly_dircap, errors_dir, magicfolderdb, inotify=fake_inotify) d.addCallback(_check_errors) return d