From f38cc13ec055fc73cd881a41537085d33ccd602d Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Tue, 11 Aug 2015 18:24:53 +0100 Subject: [PATCH] Work in progress to fix tests. Signed-off-by: Daira Hopwood --- src/allmydata/test/test_cli.py | 11 ++++++----- src/allmydata/test/test_cli_create_alias.py | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/allmydata/test/test_cli.py b/src/allmydata/test/test_cli.py index b59a2b1b..d3d85463 100644 --- a/src/allmydata/test/test_cli.py +++ b/src/allmydata/test/test_cli.py @@ -934,10 +934,10 @@ class Mkdir(GridTestMixin, CLITestMixin, unittest.TestCase): self.basedir = os.path.dirname(self.mktemp()) self.set_up_grid() d = self.do_cli("create-alias", "tahoe") - def _check((rc, out, err), st): - self.failUnlessReallyEqual(rc, 0) - self.failUnlessReallyEqual(err, "") - self.failUnlessIn(st, out) + def _check((rc, out, err), st, what): + self.failUnlessReallyEqual(rc, 0, what) + self.failUnlessReallyEqual(err, "", what) + self.failUnlessIn(st, out, what) return out def _mkdir(ign, mutable_type, uri_prefix, dirname): d2 = self.do_cli("mkdir", "--format="+mutable_type, dirname) @@ -950,7 +950,8 @@ class Mkdir(GridTestMixin, CLITestMixin, unittest.TestCase): d2.addCallback(lambda ign: self.do_cli("ls", "--json", dirname)) d2.addCallback(_check, uri_prefix) d2.addCallback(lambda ign: self.do_cli("ls", "--json", self._filecap)) - d2.addCallback(_check, '"format": "%s"' % (mutable_type.upper(),)) + d2.addCallback(_check, '"format": "%s"' % (mutable_type.upper(),), + (mutable_type, uri_prefix, dirname)) return d2 d.addCallback(_mkdir, "sdmf", "URI:DIR2", "tahoe:foo") diff --git a/src/allmydata/test/test_cli_create_alias.py b/src/allmydata/test/test_cli_create_alias.py index ae3cd5bd..7b7d5bc0 100644 --- a/src/allmydata/test/test_cli_create_alias.py +++ b/src/allmydata/test/test_cli_create_alias.py @@ -163,7 +163,8 @@ class CreateAlias(GridTestMixin, CLITestMixin, unittest.TestCase): self.failUnlessIn("Alias %s created" % quote_output(u"\u00E9tudes"), out) aliases = get_aliases(self.get_clientdir()) - self.failUnless(aliases[u"\u00E9tudes"].startswith("URI:DIR2:")) + etudes_alias = aliases[u"\u00E9tudes"] + self.failUnless(etudes_alias.startswith("URI:DIR2-MDMF:"), etudes_alias) d.addCallback(_check_create_unicode) d.addCallback(lambda res: self.do_cli("ls", etudes_arg + ":")) -- 2.45.2