From: Daira Hopwood Date: Tue, 20 Oct 2015 20:50:00 +0000 (+0100) Subject: Unicode fix for do_join. X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/statistics?a=commitdiff_plain;h=98879af6e9e55475fb28ebc3fcea1a7d5f4dad84;p=tahoe-lafs%2Ftahoe-lafs.git Unicode fix for do_join. 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 d060bf94..8c54919a 100644 --- a/src/allmydata/test/test_cli_magic_folder.py +++ b/src/allmydata/test/test_cli_magic_folder.py @@ -6,6 +6,7 @@ from twisted.internet import defer from twisted.internet import reactor from twisted.python import usage +from allmydata.util.assertutil import precondition from allmydata.util import fileutil from allmydata.util.fileutil import precondition_abspath from allmydata.scripts.common import get_aliases @@ -41,8 +42,11 @@ class MagicFolderCLITestMixin(CLITestMixin, GridTestMixin): return d def do_join(self, client_num, local_dir, invite_code): - magic_readonly_cap, dmd_write_cap = invite_code.split(magic_folder_cli.INVITE_SEPARATOR) - d = self.do_cli("magic-folder", "join", invite_code, local_dir, client_num=client_num) + precondition(isinstance(local_dir, unicode), local_dir=local_dir) + precondition(isinstance(invite_code, str), invite_code=invite_code) + + local_dir_arg = unicode_to_argv(local_dir) + d = self.do_cli("magic-folder", "join", invite_code, local_dir_arg, client_num=client_num) def _done((rc, stdout, stderr)): self.failUnlessEqual(rc, 0) return (rc, stdout, stderr) @@ -184,7 +188,7 @@ class CreateMagicFolder(MagicFolderCLITestMixin, unittest.TestCase): d.addCallback(lambda ign: self.do_invite(0, u"Alice")) def get_invite_code_and_join((rc, stdout, stderr)): invite_code = stdout.strip() - return self.do_join(0, local_dir, invite_code) + return self.do_join(0, unicode(local_dir), invite_code) d.addCallback(get_invite_code_and_join) def get_caps(ign): self.collective_dircap, self.upload_dircap = self.get_caps_from_files(0)