~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-04 18:51:39 UTC
  • mfrom: (2961.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20071104185139-kaio3sneodg2kp71
Authentication ring implementation (read-only)

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
                          TestUIFactory,
35
35
                          TestSkipped,
36
36
                          )
 
37
from bzrlib.symbol_versioning import (
 
38
    zero_eighteen,
 
39
    )
37
40
from bzrlib.tests.blackbox import ExternalBase
38
41
 
39
42
 
171
174
    def test_benchmark_runs_benchmark_tests(self):
172
175
        """bzr selftest --benchmark should not run the default test suite."""
173
176
        # We test this by passing a regression test name to --benchmark, which
174
 
        # should result in 0 tests run.
 
177
        # should result in 0 rests run.
175
178
        old_root = TestCaseWithMemoryTransport.TEST_ROOT
176
179
        try:
177
180
            TestCaseWithMemoryTransport.TEST_ROOT = None
257
260
class TestRunBzrSubprocess(TestCaseWithTransport):
258
261
 
259
262
    def test_run_bzr_subprocess(self):
260
 
        """The run_bzr_helper_external command behaves nicely."""
 
263
        """The run_bzr_helper_external comand behaves nicely."""
261
264
        result = self.run_bzr_subprocess('--version')
262
265
        result = self.run_bzr_subprocess(['--version'])
263
266
        result = self.run_bzr_subprocess('--version', retcode=None)
271
274
                                      'magic merge'], retcode=3)[1]
272
275
        self.assertContainsRe(err, 'Bad value "magic merge" for option'
273
276
                              ' "merge-type"')
 
277
        self.callDeprecated(['passing varargs to run_bzr_subprocess was'
 
278
                             ' deprecated in version 0.91.'],
 
279
                            self.run_bzr_subprocess,
 
280
                            'arg1', 'arg2', 'arg3', retcode=3)
274
281
 
275
282
    def test_run_bzr_subprocess_env(self):
276
283
        """run_bzr_subprocess can set environment variables in the child only.
551
558
            out_rand2.splitlines(), 2)
552
559
        self.assertEqual(tests_rand, tests_rand2)
553
560
 
554
 
 
555
 
class TestSelftestWithIdList(TestCaseInTempDir):
556
 
 
557
 
    def test_load_list(self):
558
 
        # We don't want to call selftest for the whole suite, so we start with
559
 
        # a reduced list.
560
 
        test_list_fname = 'test.list'
561
 
        fl = open(test_list_fname, 'wt')
562
 
        fl.write('%s\n' % self.id())
563
 
        fl.close()
564
 
        out, err = self.run_bzr(
565
 
            ['selftest', '--load-list', test_list_fname, '--list'])
566
 
        self.assertContainsRe(out, "Listed 1 test in")
567
 
 
568
 
    def test_load_unknown(self):
569
 
        out, err = self.run_bzr('selftest --load-list I_do_not_exist ',
570
 
                                retcode=3)
571
 
 
572
 
 
573
 
class TestSelftestStartingWith(TestCase):
574
 
 
575
 
    def test_starting_with_single_argument(self):
576
 
        out, err = self.run_bzr(
577
 
            ['selftest', '--starting-with', self.id(), '--list'])
578
 
        self.assertContainsRe(out, "Listed 1 test in")
579
 
        self.assertContainsRe(out, self.id())
580
 
 
581
 
    def test_starting_with_multiple_argument(self):
582
 
        out, err = self.run_bzr(
583
 
            ['selftest',
584
 
             '--starting-with', self.id(),
585
 
             '--starting-with', 'bzrlib.tests.test_sampler',
586
 
             '--list'])
587
 
        self.assertContainsRe(out, "Listed 2 tests in")
588
 
        self.assertContainsRe(out, self.id())
589
 
        self.assertContainsRe(out, 'bzrlib.tests.test_sampler')