From: Brian Warner <warner@lothar.com> Date: Wed, 4 Mar 2009 05:11:46 +0000 (-0700) Subject: test_cli: validate non-HTML error response of 'tahoe get' on an unrecoverable file X-Git-Url: https://git.rkrishnan.org/specifications//%22%3C?a=commitdiff_plain;h=c5ecb7b3bac93a17b156602399fbffeaaf01390d;p=tahoe-lafs%2Ftahoe-lafs.git test_cli: validate non-HTML error response of 'tahoe get' on an unrecoverable file --- diff --git a/src/allmydata/test/test_cli.py b/src/allmydata/test/test_cli.py index 5dc529a5..c1937a81 100644 --- a/src/allmydata/test/test_cli.py +++ b/src/allmydata/test/test_cli.py @@ -1378,3 +1378,25 @@ class Check(GridTestMixin, CLITestMixin, unittest.TestCase): return d +class Errors(GridTestMixin, CLITestMixin, unittest.TestCase): + def test_check(self): + self.basedir = "cli/Check/check" + self.set_up_grid() + c0 = self.g.clients[0] + self.fileurls = {} + DATA = "data" * 100 + d = c0.upload(upload.Data(DATA, convergence="")) + def _stash_bad(ur): + self.uri_1share = ur.uri + self.delete_shares_numbered(ur.uri, range(1,10)) + d.addCallback(_stash_bad) + + d.addCallback(lambda ign: self.do_cli("get", self.uri_1share)) + def _check1((rc, out, err)): + self.failIfEqual(rc, 0) + self.failUnless("410 Gone" in err, err) + self.failUnless("NotEnoughSharesError: 1 share found, but we need 3" in err, + err) + d.addCallback(_check1) + + return d