From c5ecb7b3bac93a17b156602399fbffeaaf01390d Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 3 Mar 2009 22:11:46 -0700 Subject: [PATCH] test_cli: validate non-HTML error response of 'tahoe get' on an unrecoverable file --- src/allmydata/test/test_cli.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 -- 2.45.2