/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_selftest.py

  • Committer: Martin Pool
  • Date: 2007-08-09 05:28:20 UTC
  • mto: This revision was merged to the branch mainline in revision 2701.
  • Revision ID: mbp@sourcefrog.net-20070809052820-dok5dy9lcibtzrsp
Revert selftest header to just two lines, but still show the bzrlib and python versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
481
481
    @staticmethod
482
482
    def _parse_test_list(lines, newlines_in_header=1):
483
483
        "Parse a list of lines into a tuple of 3 lists (header,body,footer)."
484
 
 
485
484
        in_header = True
486
485
        in_footer = False
487
486
        header = []
488
487
        body = []
489
488
        footer = []
490
 
        header_newlines_found = 0 
 
489
        header_newlines_found = 0
491
490
        for line in lines:
492
491
            if in_header:
493
492
                if line == '':
505
504
                footer.append(line)
506
505
        # If the last body line is blank, drop it off the list
507
506
        if len(body) > 0 and body[-1] == '':
508
 
            body.pop()                
 
507
            body.pop()
509
508
        return (header,body,footer)
510
509
 
511
510
    def test_list_only(self):
545
544
                                          'selftest', '--randomize', 'now'])
546
545
        (header_rand,tests_rand,dummy) = self._parse_test_list(
547
546
            out_rand.splitlines(), 2)
 
547
        # XXX: The following line asserts that the randomized order is not the
 
548
        # same as the default order.  It is just possible that they'll get
 
549
        # randomized into the same order and this will falsely fail, but
 
550
        # that's very unlikely in practice because there are thousands of
 
551
        # tests.
548
552
        self.assertNotEqual(tests_all, tests_rand)
549
553
        self.assertEqual(sorted(tests_all), sorted(tests_rand))
550
554
        # Check that the seed can be reused to get the exact same order