From 8ce7e2430c4b956481715e8300218b5963ef8e30 Mon Sep 17 00:00:00 2001
From: Daira Hopwood <daira@jacaranda.org>
Date: Tue, 1 Dec 2015 17:58:16 +0000
Subject: [PATCH] Add test for 'tahoe create-node/client/introducer' output.
 closes ticket:2556

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
---
 src/allmydata/test/test_runner.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/allmydata/test/test_runner.py b/src/allmydata/test/test_runner.py
index 3c79777f..66ca466c 100644
--- a/src/allmydata/test/test_runner.py
+++ b/src/allmydata/test/test_runner.py
@@ -298,6 +298,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,
-- 
2.45.2