1659
1659
self.check_inventory_shape(tree.inventory, files)
1664
class TestBlackboxSupport(TestCase):
1665
"""Tests for testsuite blackbox features."""
1667
def test_run_bzr_failure_not_caught(self):
1668
# When we run bzr in blackbox mode, we want any unexpected errors to
1669
# propagate up to the test suite so that it can show the error in the
1670
# usual way, and we won't get a double traceback.
1671
e = self.assertRaises(
1673
self.run_bzr, ['assert-fail'])
1674
# make sure we got the real thing, not an error from somewhere else in
1675
# the test framework
1676
self.assertEquals('always fails', str(e))
1677
# check that there's no traceback in the test log
1678
self.assertNotContainsRe(self._get_log(keep_log_file=True),
1681
def test_run_bzr_user_error_caught(self):
1682
# Running bzr in blackbox mode, normal/expected/user errors should be
1683
# caught in the regular way and turned into an error message plus exit
1685
out, err = self.run_bzr(["log", "/nonexistantpath"], retcode=3)
1686
self.assertEqual(out, '')
1687
self.assertEqual(err, 'bzr: ERROR: Not a branch: "/nonexistantpath/".\n')