~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: 2009-07-20 05:47:35 UTC
  • mfrom: (4536.5.5 trivial)
  • Revision ID: pqm@pqm.ubuntu.com-20090720054735-0ypvcqtqpx72poyv
(mbp) tweaks to selftest output format

Show diffs side-by-side

added added

removed removed

Lines of Context:
723
723
                self.time(time.sleep, 0.003)
724
724
        self.check_timing(ShortDelayTestCase('test_short_delay'),
725
725
                          r"^ +[0-9]+ms$")
726
 
        # if a benchmark time is given, we want a x of y style result.
 
726
        # if a benchmark time is given, we now show just that time followed by
 
727
        # a star
727
728
        self.check_timing(ShortDelayTestCase('test_short_benchmark'),
728
 
                          r"^ +[0-9]+ms/ +[0-9]+ms$")
 
729
                          r"^ +[0-9]+ms\*$")
729
730
 
730
731
    def test_unittest_reporting_unittest_class(self):
731
732
        # getting the time from a non-bzrlib test works ok
943
944
        result.report_unsupported(test, feature)
944
945
        output = result_stream.getvalue()[prefix:]
945
946
        lines = output.splitlines()
946
 
        self.assertEqual(lines, ['NODEP                   0ms',
 
947
        self.assertEqual(lines, ['NODEP        0ms',
947
948
                                 "    The feature 'Feature' is not available."])
948
949
 
949
950
    def test_text_report_unsupported(self):
1490
1491
        sample_test.run(result)
1491
1492
        self.assertContainsRe(
1492
1493
            output_stream.getvalue(),
1493
 
            r"\d+ms/ +\d+ms\n$")
 
1494
            r"\d+ms\*\n$")
1494
1495
 
1495
1496
    def test_hooks_sanitised(self):
1496
1497
        """The bzrlib hooks should be sanitised by setUp."""