]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Add precondition that arguments to do_cli are strs.
authorDaira Hopwood <daira@jacaranda.org>
Tue, 20 Oct 2015 14:12:36 +0000 (15:12 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Tue, 20 Oct 2015 14:12:36 +0000 (15:12 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/test/test_cli.py

index 9cfaf6593f06cbe1a4cf687eed7e4eaaa67337f8..bed358711097576337996af159f675ba7e4400ab 100644 (file)
@@ -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,11 +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(i=client_num),
+            "--node-directory", unicode_to_argv(self.get_clientdir(i=client_num)),
             ]
         argv = nodeargs + [verb] + list(args)
         stdin = kwargs.get("stdin", "")