]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
test_cli: add test coverage for help strings
authorBrian Warner <warner@lothar.com>
Mon, 16 Feb 2009 22:08:33 +0000 (15:08 -0700)
committerBrian Warner <warner@lothar.com>
Mon, 16 Feb 2009 22:08:33 +0000 (15:08 -0700)
src/allmydata/scripts/cli.py
src/allmydata/test/test_cli.py

index 87d6b2792d1699e4b277dc40620c648a458a28fb..da1a13745abb9b4e087034cf0e9e248ec2ef5b1e 100644 (file)
@@ -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):
index 1ee4b9f293fb726fc9f806395063fcdb310d389c..5cd58cc91fd53b8bb794e44cb0925acc358909e2 100644 (file)
@@ -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 = [