From: Daira Hopwood Date: Mon, 28 Dec 2015 20:46:16 +0000 (+0000) Subject: Require arguments to do_cli to be strs. X-Git-Url: https://git.rkrishnan.org/vdrive/%22file:/somewhere?a=commitdiff_plain;h=394a4e25e64e0744ddcaf3dbd15ad5238e2b8047;p=tahoe-lafs%2Ftahoe-lafs.git Require arguments to do_cli to be strs. Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/test/test_cli.py b/src/allmydata/test/test_cli.py index b59a2b1b..bed35871 100644 --- a/src/allmydata/test/test_cli.py +++ b/src/allmydata/test/test_cli.py @@ -36,7 +36,7 @@ from twisted.python import usage from allmydata.util.assertutil import precondition from allmydata.util.encodingutil import listdir_unicode, unicode_platform, \ - get_io_encoding, get_filesystem_encoding + get_io_encoding, get_filesystem_encoding, unicode_to_argv timeout = 480 # deep_check takes 360s on Zandr's linksys box, others take > 240s @@ -49,8 +49,14 @@ def parse_options(basedir, command, args): class CLITestMixin(ReallyEqualMixin): def do_cli(self, verb, *args, **kwargs): + precondition(not [True for arg in args if not isinstance(arg, str)], + "arguments to do_cli must be strs -- convert using unicode_to_argv", args=args) + + # client_num is used to execute client CLI commands on a specific client. + client_num = kwargs.get("client_num", 0) + nodeargs = [ - "--node-directory", self.get_clientdir(), + "--node-directory", unicode_to_argv(self.get_clientdir(i=client_num)), ] argv = nodeargs + [verb] + list(args) stdin = kwargs.get("stdin", "")