mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-29 15:29:49 +00:00
runner.py: add --quiet, use it from test cases
This commit is contained in:
parent
8307aaccb6
commit
d1a848e0a7
@ -22,6 +22,9 @@ class CreateClientOptions(usage.Options):
|
|||||||
optParameters = [
|
optParameters = [
|
||||||
["basedir", "C", None, "which directory to create the client in"],
|
["basedir", "C", None, "which directory to create the client in"],
|
||||||
]
|
]
|
||||||
|
optFlags = [
|
||||||
|
["quiet", "q", "operate silently"],
|
||||||
|
]
|
||||||
|
|
||||||
def parseArgs(self, *args):
|
def parseArgs(self, *args):
|
||||||
if len(args) > 0:
|
if len(args) > 0:
|
||||||
@ -38,6 +41,9 @@ class CreateIntroducerOptions(usage.Options):
|
|||||||
optParameters = [
|
optParameters = [
|
||||||
["basedir", "C", None, "which directory to create the introducer in"],
|
["basedir", "C", None, "which directory to create the introducer in"],
|
||||||
]
|
]
|
||||||
|
optFlags = [
|
||||||
|
["quiet", "q", "operate silently"],
|
||||||
|
]
|
||||||
|
|
||||||
def parseArgs(self, *args):
|
def parseArgs(self, *args):
|
||||||
if len(args) > 0:
|
if len(args) > 0:
|
||||||
@ -134,8 +140,9 @@ def create_client(config):
|
|||||||
f = open(os.path.join(basedir, "client.tac"), "w")
|
f = open(os.path.join(basedir, "client.tac"), "w")
|
||||||
f.write(client_tac)
|
f.write(client_tac)
|
||||||
f.close()
|
f.close()
|
||||||
print "client created in %s" % basedir
|
if not config['quiet']:
|
||||||
print " please copy introducer.furl and vdrive.furl into the directory"
|
print "client created in %s" % basedir
|
||||||
|
print " please copy introducer.furl and vdrive.furl into the directory"
|
||||||
|
|
||||||
def create_introducer(config):
|
def create_introducer(config):
|
||||||
basedir = config['basedir']
|
basedir = config['basedir']
|
||||||
@ -151,7 +158,8 @@ def create_introducer(config):
|
|||||||
f = open(os.path.join(basedir, "introducer.tac"), "w")
|
f = open(os.path.join(basedir, "introducer.tac"), "w")
|
||||||
f.write(introducer_tac)
|
f.write(introducer_tac)
|
||||||
f.close()
|
f.close()
|
||||||
print "introducer created in %s" % basedir
|
if not config['quiet']:
|
||||||
|
print "introducer created in %s" % basedir
|
||||||
|
|
||||||
def start(config):
|
def start(config):
|
||||||
basedir = config['basedir']
|
basedir = config['basedir']
|
||||||
|
@ -14,7 +14,7 @@ class CreateNode(unittest.TestCase):
|
|||||||
def test_client(self):
|
def test_client(self):
|
||||||
basedir = self.workdir("test_client")
|
basedir = self.workdir("test_client")
|
||||||
c1 = os.path.join(basedir, "c1")
|
c1 = os.path.join(basedir, "c1")
|
||||||
argv = ["create-client", "--basedir", c1]
|
argv = ["create-client", "--basedir", c1, "--quiet"]
|
||||||
runner.runner(argv)
|
runner.runner(argv)
|
||||||
self.failUnless(os.path.exists(c1))
|
self.failUnless(os.path.exists(c1))
|
||||||
self.failUnless(os.path.exists(os.path.join(c1, "client.tac")))
|
self.failUnless(os.path.exists(os.path.join(c1, "client.tac")))
|
||||||
@ -22,7 +22,7 @@ class CreateNode(unittest.TestCase):
|
|||||||
def test_introducer(self):
|
def test_introducer(self):
|
||||||
basedir = self.workdir("test_introducer")
|
basedir = self.workdir("test_introducer")
|
||||||
c1 = os.path.join(basedir, "c1")
|
c1 = os.path.join(basedir, "c1")
|
||||||
argv = ["create-introducer", "--basedir", c1]
|
argv = ["create-introducer", "--basedir", c1, "--quiet"]
|
||||||
runner.runner(argv)
|
runner.runner(argv)
|
||||||
self.failUnless(os.path.exists(c1))
|
self.failUnless(os.path.exists(c1))
|
||||||
self.failUnless(os.path.exists(os.path.join(c1, "introducer.tac")))
|
self.failUnless(os.path.exists(os.path.join(c1, "introducer.tac")))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user