From: David Stainton Date: Mon, 19 Oct 2015 14:14:12 +0000 (+0200) Subject: Fix tests by submitting unicode args instead of str X-Git-Url: https://git.rkrishnan.org/pf/content/en/service/somewhere?a=commitdiff_plain;h=09871d76c7af42b0d8a1b1dfe048c4dd1177af1c;p=tahoe-lafs%2Ftahoe-lafs.git Fix tests by submitting unicode args instead of str --- diff --git a/src/allmydata/scripts/magic_folder_cli.py b/src/allmydata/scripts/magic_folder_cli.py index 0f45b1ab..5356ce8b 100644 --- a/src/allmydata/scripts/magic_folder_cli.py +++ b/src/allmydata/scripts/magic_folder_cli.py @@ -22,7 +22,7 @@ class CreateOptions(BasedirOptions): raise usage.UsageError("An alias must end with a ':' character.") self.alias = alias[:-1] self.nickname = nickname - self.localdir = argv_to_abspath(str(localdir)) + self.localdir = localdir if self.nickname and not self.localdir: raise usage.UsageError("If NICKNAME is specified then LOCALDIR must also be specified.") node_url_file = os.path.join(self['node-directory'], "node.url") diff --git a/src/allmydata/test/test_cli_magic_folder.py b/src/allmydata/test/test_cli_magic_folder.py index cdd7df9c..8683c893 100644 --- a/src/allmydata/test/test_cli_magic_folder.py +++ b/src/allmydata/test/test_cli_magic_folder.py @@ -11,6 +11,7 @@ from allmydata.test.no_network import GridTestMixin from .test_cli import CLITestMixin from allmydata.scripts import magic_folder_cli from allmydata.util.fileutil import abspath_expanduser_unicode +from allmydata.util.encodingutil import argv_to_abspath from allmydata.frontends.magic_folder import MagicFolder from allmydata import uri @@ -175,7 +176,7 @@ class CreateMagicFolder(MagicFolderCLITestMixin, unittest.TestCase): def test_create_and_then_invite_join(self): self.basedir = "cli/MagicFolder/create-and-then-invite-join" self.set_up_grid() - self.local_dir = os.path.join(self.basedir, "magic") + 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")) def get_invite((rc,stdout,stderr)): @@ -220,7 +221,7 @@ class CreateMagicFolder(MagicFolderCLITestMixin, unittest.TestCase): self.basedir = "cli/MagicFolder/create-invite-join-failure" self.set_up_grid() self.local_dir = os.path.join(self.basedir, "magic") - self.local_dir = "-" + self.local_dir + self.local_dir = argv_to_abspath("-" + self.local_dir) d = self.do_cli("magic-folder", "create", u"magic:", u"Alice", self.local_dir) def _done((rc,stdout,stderr)): print "rc %s" % (rc,)