Ticket #1129: test-tahoe-version-no-warning.dpatch

File test-tahoe-version-no-warning.dpatch, 1.9 KB (added by davidsarah, at 2010-07-20T01:28:52Z)

test_runner: test that 'tahoe --version' outputs no noise (e.g. DeprecationWarnings?).

Line 
1Tue Jul 20 02:13:45 GMT Daylight Time 2010  david-sarah@jacaranda.org
2  * test_runner: test that 'tahoe --version' outputs no noise (e.g. DeprecationWarnings).
3
4New patches:
5
6[test_runner: test that 'tahoe --version' outputs no noise (e.g. DeprecationWarnings).
7david-sarah@jacaranda.org**20100720011345
8 Ignore-this: dd358b7b2e5d57282cbe133e8069702e
9] {
10hunk ./src/allmydata/test/test_runner.py 34
11             raise unittest.SkipTest("twistd does not fork under windows")
12 
13 
14-class TheRightCode(common_util.SignalMixin, unittest.TestCase, SkipMixin):
15+class BinTahoe(common_util.SignalMixin, unittest.TestCase, SkipMixin):
16     def test_path(self):
17         self.skip_if_cannot_run_bintahoe()
18         d = utils.getProcessOutputAndValue(bintahoe, args=["--version-and-path"], env=os.environ)
19hunk ./src/allmydata/test/test_runner.py 51
20         d.addCallback(_cb)
21         return d
22 
23+    def test_version_no_noise(self):
24+        self.skip_if_cannot_run_bintahoe()
25+        import pkg_resources
26+        try:
27+            pkg_resources.require("Twisted>=9.0.0")
28+        except pkg_resources.VersionConflict:
29+            raise unittest.SkipTest("We pass this test only with Twisted >= v9.0.0")
30+
31+        d = utils.getProcessOutputAndValue(bintahoe, args=["--version"], env=os.environ)
32+        def _cb(res):
33+            out, err, rc_or_sig = res
34+            self.failUnlessEqual(rc_or_sig, 0, res)
35+            self.failUnless(out.startswith("allmydata-tahoe:"), res)
36+            self.failIfIn("DeprecationWarning", out, res)
37+            self.failUnlessEqual(err, "", res)
38+        d.addCallback(_cb)
39+        return d
40+
41 
42 class CreateNode(unittest.TestCase):
43     # exercise "tahoe create-node", create-introducer,
44}
45
46Context:
47
48[TAG allmydata-tahoe-1.7.1
49zooko@zooko.com**20100719131352
50 Ignore-this: 6942056548433dc653a746703819ad8c
51] 
52Patch bundle hash:
531585b7d1c7a9a2c3e6974d0aaba9a3be1d92999e