From: Brian Warner Date: Mon, 16 Feb 2009 22:08:33 +0000 (-0700) Subject: test_cli: add test coverage for help strings X-Git-Tag: allmydata-tahoe-1.4.0~214 X-Git-Url: https://git.rkrishnan.org/pf/content/en/footer/module-simplejson.encoder.html?a=commitdiff_plain;h=770f976a850082fdc139eb9d6897e4aeacd6c108;p=tahoe-lafs%2Ftahoe-lafs.git test_cli: add test coverage for help strings --- diff --git a/src/allmydata/scripts/cli.py b/src/allmydata/scripts/cli.py index 87d6b279..da1a1374 100644 --- a/src/allmydata/scripts/cli.py +++ b/src/allmydata/scripts/cli.py @@ -172,7 +172,7 @@ class RmOptions(VDriveOptions): self.where = where def getSynopsis(self): - return "%s rm VE_FILE" % (os.path.basename(sys.argv[0]),) + return "%s rm VDRIVE_FILE" % (os.path.basename(sys.argv[0]),) class MvOptions(VDriveOptions): def parseArgs(self, frompath, topath): diff --git a/src/allmydata/test/test_cli.py b/src/allmydata/test/test_cli.py index 1ee4b9f2..5cd58cc9 100644 --- a/src/allmydata/test/test_cli.py +++ b/src/allmydata/test/test_cli.py @@ -272,6 +272,54 @@ class CLI(unittest.TestCase): "didn't see 'mqfblse6m5a6dh45isu2cg7oji' in '%s'" % err) +class Help(unittest.TestCase): + + def test_get(self): + help = str(cli.GetOptions()) + self.failUnless("get VDRIVE_FILE LOCAL_FILE" in help, help) + self.failUnless("% tahoe get FOO |less" in help, help) + + def test_put(self): + help = str(cli.PutOptions()) + self.failUnless("put LOCAL_FILE VDRIVE_FILE" in help, help) + self.failUnless("% cat FILE | tahoe put" in help, help) + + def test_rm(self): + help = str(cli.RmOptions()) + self.failUnless("rm VDRIVE_FILE" in help, help) + + def test_mv(self): + help = str(cli.MvOptions()) + self.failUnless("mv FROM TO" in help, help) + + def test_ln(self): + help = str(cli.LnOptions()) + self.failUnless("ln FROM TO" in help, help) + + def test_backup(self): + help = str(cli.BackupOptions()) + self.failUnless("backup FROM ALIAS:TO" in help, help) + + def test_webopen(self): + help = str(cli.WebopenOptions()) + self.failUnless("webopen [ALIAS:PATH]" in help, help) + + def test_manifest(self): + help = str(cli.ManifestOptions()) + self.failUnless("manifest [ALIAS:PATH]" in help, help) + + def test_stats(self): + help = str(cli.StatsOptions()) + self.failUnless("stats [ALIAS:PATH]" in help, help) + + def test_check(self): + help = str(cli.CheckOptions()) + self.failUnless("check [ALIAS:PATH]" in help, help) + + def test_deep_check(self): + help = str(cli.DeepCheckOptions()) + self.failUnless("deep-check [ALIAS:PATH]" in help, help) + class CLITestMixin: def do_cli(self, verb, *args, **kwargs): nodeargs = [