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):
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)
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))