Add test for 'tahoe create-node/client/introducer' output. closes ticket:2556 1431.magic-folder-windows.2
authorDaira Hopwood <daira@jacaranda.org>
Wed, 28 Oct 2015 13:49:43 +0000 (13:49 +0000)
committerDaira Hopwood <daira@jacaranda.org>
Wed, 28 Oct 2015 13:49:43 +0000 (13:49 +0000)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/test/test_runner.py

index 06d9f103631211d2f62d8b94de55e32a77830552..e737213f69d43af83ea486b112a702a9780a25de 100644 (file)
@@ -7,7 +7,8 @@ from twisted.python import usage, runtime
 from twisted.internet import threads
 
 from allmydata.util import fileutil, pollmixin
-from allmydata.util.encodingutil import unicode_to_argv, unicode_to_output, get_filesystem_encoding
+from allmydata.util.encodingutil import unicode_to_argv, unicode_to_output, \
+    get_filesystem_encoding, quote_local_unicode_path
 from allmydata.scripts import runner
 from allmydata.client import Client
 from allmydata.test import common_util
@@ -298,6 +299,19 @@ class CreateNode(unittest.TestCase):
         self.failUnless(os.path.exists(n3))
         self.failUnless(os.path.exists(os.path.join(n3, tac)))
 
+        if kind in ("client", "node", "introducer"):
+            # test that the output (without --quiet) includes the base directory
+            n4 = os.path.join(basedir, command + "-n4")
+            argv = [command, n4]
+            rc, out, err = self.run_tahoe(argv)
+            self.failUnlessEqual(err, "")
+            self.failUnlessIn(" created in ", out)
+            self.failUnlessIn(n4, out)
+            self.failIfIn("\\\\?\\", out)
+            self.failUnlessEqual(rc, 0)
+            self.failUnless(os.path.exists(n4))
+            self.failUnless(os.path.exists(os.path.join(n4, tac)))
+
         # make sure it rejects too many arguments
         argv = [command, "basedir", "extraarg"]
         self.failUnlessRaises(usage.UsageError,