mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 00:24:13 +00:00
Fix some potential bugs in test code exposed by check-miscaptures.py. refs #1556
This commit is contained in:
parent
11ce612589
commit
bdfa7b3772
@ -757,9 +757,9 @@ class CreateAlias(GridTestMixin, CLITestMixin, unittest.TestCase):
|
||||
self.failUnlessIn("cannot contain", stderr)
|
||||
|
||||
for invalid in ['foo:bar', 'foo bar', 'foobar::']:
|
||||
d.addCallback(lambda res: self.do_cli("create-alias", invalid))
|
||||
d.addCallback(lambda res, invalid=invalid: self.do_cli("create-alias", invalid))
|
||||
d.addCallback(_check_invalid)
|
||||
d.addCallback(lambda res: self.do_cli("add-alias", invalid, self.two_uri))
|
||||
d.addCallback(lambda res, invalid=invalid: self.do_cli("add-alias", invalid, self.two_uri))
|
||||
d.addCallback(_check_invalid)
|
||||
|
||||
def _test_urls(junk):
|
||||
|
@ -1710,16 +1710,16 @@ class Dirnode2(testutil.ReallyEqualMixin, testutil.ShouldFailMixin, unittest.Tes
|
||||
n.raise_error()
|
||||
|
||||
for (i, n) in unknown_rw:
|
||||
self.failUnlessRaises(MustNotBeUnknownRWError, lambda: n.raise_error())
|
||||
self.failUnlessRaises(MustNotBeUnknownRWError, lambda n=n: n.raise_error())
|
||||
|
||||
for (i, n) in must_be_ro:
|
||||
self.failUnlessRaises(MustBeReadonlyError, lambda: n.raise_error())
|
||||
self.failUnlessRaises(MustBeReadonlyError, lambda n=n: n.raise_error())
|
||||
|
||||
for (i, n) in must_be_imm:
|
||||
self.failUnlessRaises(MustBeDeepImmutableError, lambda: n.raise_error())
|
||||
self.failUnlessRaises(MustBeDeepImmutableError, lambda n=n: n.raise_error())
|
||||
|
||||
for (i, n) in bad_uri:
|
||||
self.failUnlessRaises(uri.BadURIError, lambda: n.raise_error())
|
||||
self.failUnlessRaises(uri.BadURIError, lambda n=n: n.raise_error())
|
||||
|
||||
for (i, n) in ok:
|
||||
self.failIf(n.get_readonly_uri() is None, i)
|
||||
|
@ -1115,7 +1115,7 @@ class Corruption(_Base, unittest.TestCase):
|
||||
for i,which,substring in corrupt_me:
|
||||
# All these tests result in a failed download.
|
||||
d.addCallback(self._corrupt_flip_all, imm_uri, i)
|
||||
d.addCallback(lambda ign:
|
||||
d.addCallback(lambda ign, which=which, substring=substring:
|
||||
self.shouldFail(NoSharesError, which,
|
||||
substring,
|
||||
_download, imm_uri))
|
||||
|
Loading…
x
Reference in New Issue
Block a user