From: Daira Hopwood Date: Tue, 20 Oct 2015 16:27:38 +0000 (+0100) Subject: Cosmetics. X-Git-Url: https://git.rkrishnan.org/vdrive/%22news.html/pb.xhtml?a=commitdiff_plain;h=5eaf2368e4344ca0d9eeb64af1377a04e0955629;p=tahoe-lafs%2Ftahoe-lafs.git Cosmetics. Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/test/test_cli_magic_folder.py b/src/allmydata/test/test_cli_magic_folder.py index 3dc6cbe6..4dc1a43f 100644 --- a/src/allmydata/test/test_cli_magic_folder.py +++ b/src/allmydata/test/test_cli_magic_folder.py @@ -18,7 +18,6 @@ from allmydata import uri class MagicFolderCLITestMixin(CLITestMixin, GridTestMixin): - def do_create_magic_folder(self, client_num): d = self.do_cli("magic-folder", "create", "magic:", client_num=client_num) def _done((rc,stdout,stderr)): @@ -80,7 +79,7 @@ class MagicFolderCLITestMixin(CLITestMixin, GridTestMixin): def create_invite_join_magic_folder(self, nickname, local_dir): d = self.do_cli("magic-folder", "create", u"magic:", nickname, local_dir) - def _done((rc,stdout,stderr)): + def _done((rc, stdout, stderr)): self.failUnless(rc == 0) return (rc,stdout,stderr) d.addCallback(_done) @@ -90,8 +89,8 @@ class MagicFolderCLITestMixin(CLITestMixin, GridTestMixin): self.collective_dirnode = client.create_node_from_uri(self.collective_dircap) self.upload_dirnode = client.create_node_from_uri(self.upload_dircap) d.addCallback(get_alice_caps) - d.addCallback(lambda x: self.check_joined_config(0, self.upload_dircap)) - d.addCallback(lambda x: self.check_config(0, local_dir)) + d.addCallback(lambda ign: self.check_joined_config(0, self.upload_dircap)) + d.addCallback(lambda ign: self.check_config(0, local_dir)) return d def cleanup(self, res): @@ -132,32 +131,32 @@ class MagicFolderCLITestMixin(CLITestMixin, GridTestMixin): # Alice creates a Magic Folder, # invites herself then and joins. d = self.do_create_magic_folder(0) - d.addCallback(lambda x: self.do_invite(0, u"Alice\u00F8")) + d.addCallback(lambda ign: self.do_invite(0, u"Alice\u00F8")) def get_invitecode(result): self.invitecode = result[1].strip() d.addCallback(get_invitecode) - d.addCallback(lambda x: self.do_join(0, alice_magic_dir, self.invitecode)) - def get_alice_caps(x): + d.addCallback(lambda ign: self.do_join(0, alice_magic_dir, self.invitecode)) + def get_alice_caps(ign): self.alice_collective_dircap, self.alice_upload_dircap = self.get_caps_from_files(0) d.addCallback(get_alice_caps) - d.addCallback(lambda x: self.check_joined_config(0, self.alice_upload_dircap)) - d.addCallback(lambda x: self.check_config(0, alice_magic_dir)) + d.addCallback(lambda ign: self.check_joined_config(0, self.alice_upload_dircap)) + d.addCallback(lambda ign: self.check_config(0, alice_magic_dir)) def get_Alice_magicfolder(result): self.alice_magicfolder = self.init_magicfolder(0, self.alice_upload_dircap, self.alice_collective_dircap, alice_magic_dir, alice_clock) return result d.addCallback(get_Alice_magicfolder) # Alice invites Bob. Bob joins. - d.addCallback(lambda x: self.do_invite(0, u"Bob\u00F8")) + d.addCallback(lambda ign: self.do_invite(0, u"Bob\u00F8")) def get_invitecode(result): self.invitecode = result[1].strip() d.addCallback(get_invitecode) - d.addCallback(lambda x: self.do_join(1, bob_magic_dir, self.invitecode)) - def get_bob_caps(x): + d.addCallback(lambda ign: self.do_join(1, bob_magic_dir, self.invitecode)) + def get_bob_caps(ign): self.bob_collective_dircap, self.bob_upload_dircap = self.get_caps_from_files(1) d.addCallback(get_bob_caps) - d.addCallback(lambda x: self.check_joined_config(1, self.bob_upload_dircap)) - d.addCallback(lambda x: self.check_config(1, bob_magic_dir)) + d.addCallback(lambda ign: self.check_joined_config(1, self.bob_upload_dircap)) + d.addCallback(lambda ign: self.check_config(1, bob_magic_dir)) def get_Bob_magicfolder(result): self.bob_magicfolder = self.init_magicfolder(1, self.bob_upload_dircap, self.bob_collective_dircap, bob_magic_dir, bob_clock) return result @@ -178,15 +177,15 @@ class CreateMagicFolder(MagicFolderCLITestMixin, unittest.TestCase): self.set_up_grid() self.local_dir = argv_to_abspath(os.path.join(self.basedir, "magic")) d = self.do_create_magic_folder(0) - d.addCallback(lambda x: self.do_invite(0, u"Alice")) + d.addCallback(lambda ign: self.do_invite(0, u"Alice")) def get_invite((rc,stdout,stderr)): self.invite_code = stdout.strip() d.addCallback(get_invite) d.addCallback(lambda x: self.do_join(0, self.local_dir, self.invite_code)) - def get_caps(x): + def get_caps(ign): self.collective_dircap, self.upload_dircap = self.get_caps_from_files(0) d.addCallback(get_caps) - d.addCallback(lambda x: self.check_joined_config(0, self.upload_dircap)) + d.addCallback(lambda ign: self.check_joined_config(0, self.upload_dircap)) d.addCallback(lambda x: self.check_config(0, self.local_dir)) return d @@ -195,7 +194,7 @@ class CreateMagicFolder(MagicFolderCLITestMixin, unittest.TestCase): self.set_up_grid() self.local_dir = os.path.join(self.basedir, "magic") d = self.do_cli("magic-folder", "create", "m a g i c:", client_num=0) - def _done((rc,stdout,stderr)): + def _done((rc, stdout, stderr)): self.failIfEqual(rc, 0) self.failUnlessIn("Alias names cannot contain spaces.", stderr) d.addCallback(_done) @@ -206,14 +205,14 @@ class CreateMagicFolder(MagicFolderCLITestMixin, unittest.TestCase): self.set_up_grid() self.local_dir = os.path.join(self.basedir, "magic") d = self.do_cli("magic-folder", "create", u"magic:", u"Alice", self.local_dir) - def _done((rc,stdout,stderr)): + def _done((rc, stdout, stderr)): self.failUnless(rc == 0) return (rc,stdout,stderr) d.addCallback(_done) - def get_caps(x): + def get_caps(ign): self.collective_dircap, self.upload_dircap = self.get_caps_from_files(0) d.addCallback(get_caps) - d.addCallback(lambda x: self.check_joined_config(0, self.upload_dircap)) + d.addCallback(lambda ign: self.check_joined_config(0, self.upload_dircap)) d.addCallback(lambda x: self.check_config(0, self.local_dir)) return d diff --git a/src/allmydata/test/test_magic_folder.py b/src/allmydata/test/test_magic_folder.py index 39a71ed1..5995c11b 100644 --- a/src/allmydata/test/test_magic_folder.py +++ b/src/allmydata/test/test_magic_folder.py @@ -67,7 +67,6 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual fileutil.make_dirs(self.basedir) db = self._createdb() - relpath1 = u"myFile1" pathinfo = fileutil.PathInfo(isdir=False, isfile=True, islink=False, exists=True, size=1, mtime=123, ctime=456)