~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-08-22 16:40:41 UTC
  • mfrom: (1558.14.13 Aaron's integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060822164041-3ff8e0735c0cb7c0
Fix up test_bench_history

Show diffs side-by-side

added added

removed removed

Lines of Context:
706
706
 
707
707
    def test_bench_history(self):
708
708
        import bzrlib.branch
709
 
        import bzrlib.revisionspec
 
709
        try:
 
710
            branch = bzrlib.branch.Branch.open_containing(__file__)[0]
 
711
        except errors.NotBranchError:
 
712
            raise TestSkipped(
 
713
                'Test must be run in a bzr.dev tree, not an installed copy.')
710
714
        test = TestRunner('dummy_test')
711
715
        output = StringIO()
712
716
        runner = TextTestRunner(stream=self._log_file, bench_history=output)
713
717
        result = self.run_test_runner(runner, test)
714
718
        output_string = output.getvalue()
715
 
        # does anyone know a good regexp for revision ids?
716
 
        # here we are using \S instead and checking the revision id afterwards
717
719
        self.assertContainsRe(output_string, "--date [0-9.]+ \S")
718
 
        branch = bzrlib.branch.Branch.open_containing('.')[0]
719
 
        revision_id = bzrlib.revisionspec.RevisionSpec(branch.revno()).in_history(branch).rev_id
720
 
        self.assert_(output_string.rstrip().endswith(revision_id))
 
720
        revision_id = branch.last_revision()
 
721
        self.assertEndsWith(output_string.rstrip(), revision_id)
721
722
 
722
723
 
723
724
class TestTestCase(TestCase):