Improve the failure mode for this test.

Make it show stderr if there is any and stdout if the expected content is missing.
This commit is contained in:
Jean-Paul Calderone 2019-01-30 19:02:13 -05:00
parent 89bb68254b
commit f61b51619d

View File

@ -33,8 +33,8 @@ class CreateAlias(GridTestMixin, CLITestMixin, unittest.TestCase):
d = self.do_cli("create-alias", "tahoe") d = self.do_cli("create-alias", "tahoe")
def _done((rc,stdout,stderr)): def _done((rc,stdout,stderr)):
self.failUnless("Alias 'tahoe' created" in stdout) self.assertEqual(stderr, "")
self.failIf(stderr) self.assertIn("Alias 'tahoe' created", stdout)
aliases = get_aliases(self.get_clientdir()) aliases = get_aliases(self.get_clientdir())
self.failUnless("tahoe" in aliases) self.failUnless("tahoe" in aliases)
self.failUnless(aliases["tahoe"].startswith("URI:DIR2:")) self.failUnless(aliases["tahoe"].startswith("URI:DIR2:"))