]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
test_runner: test that 'tahoe --version' outputs no noise (e.g. DeprecationWarnings).
authordavid-sarah <david-sarah@jacaranda.org>
Tue, 20 Jul 2010 01:13:45 +0000 (18:13 -0700)
committerdavid-sarah <david-sarah@jacaranda.org>
Tue, 20 Jul 2010 01:13:45 +0000 (18:13 -0700)
src/allmydata/test/test_runner.py

index c617dd62fd24cf05ebb1186da59df7a7321a05ac..5ff10ba7cb7f6e9bd3297af0d46830f58c2a8ce0 100644 (file)
@@ -31,7 +31,7 @@ class SkipMixin:
             raise unittest.SkipTest("twistd does not fork under windows")
 
 
-class TheRightCode(common_util.SignalMixin, unittest.TestCase, SkipMixin):
+class BinTahoe(common_util.SignalMixin, unittest.TestCase, SkipMixin):
     def test_path(self):
         self.skip_if_cannot_run_bintahoe()
         d = utils.getProcessOutputAndValue(bintahoe, args=["--version-and-path"], env=os.environ)
@@ -48,6 +48,24 @@ class TheRightCode(common_util.SignalMixin, unittest.TestCase, SkipMixin):
         d.addCallback(_cb)
         return d
 
+    def test_version_no_noise(self):
+        self.skip_if_cannot_run_bintahoe()
+        import pkg_resources
+        try:
+            pkg_resources.require("Twisted>=9.0.0")
+        except pkg_resources.VersionConflict:
+            raise unittest.SkipTest("We pass this test only with Twisted >= v9.0.0")
+
+        d = utils.getProcessOutputAndValue(bintahoe, args=["--version"], env=os.environ)
+        def _cb(res):
+            out, err, rc_or_sig = res
+            self.failUnlessEqual(rc_or_sig, 0, res)
+            self.failUnless(out.startswith("allmydata-tahoe:"), res)
+            self.failIfIn("DeprecationWarning", out, res)
+            self.failUnlessEqual(err, "", res)
+        d.addCallback(_cb)
+        return d
+
 
 class CreateNode(unittest.TestCase):
     # exercise "tahoe create-node", create-introducer,