/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: Robert Collins
  • Date: 2006-09-18 05:35:44 UTC
  • mto: (1986.4.4 test_ancestry.py)
  • mto: This revision was merged to the branch mainline in revision 2059.
  • Revision ID: robertc@robertcollins.net-20060918053544-531ddf7fd2ae877b
New test base class TestCaseWithMemoryTransport offers memory-only
testing facilities: its not suitable for tests that need to mutate disk
state, but most tests should not need that and should be converted to
TestCaseWithMemoryTransport. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib.errors import ParamikoNotPresent
27
27
from bzrlib.tests import (
28
28
                          TestCase,
29
 
                          TestCaseInTempDir,
 
29
                          TestCaseWithMemoryTransport,
30
30
                          TestCaseWithTransport,
31
31
                          TestSkipped,
32
32
                          )
65
65
        except ParamikoNotPresent:
66
66
            raise TestSkipped("Paramiko not present")
67
67
        old_transport = bzrlib.tests.default_transport
68
 
        old_root = TestCaseInTempDir.TEST_ROOT
69
 
        TestCaseInTempDir.TEST_ROOT = None
 
68
        old_root = TestCaseWithMemoryTransport.TEST_ROOT
 
69
        TestCaseWithMemoryTransport.TEST_ROOT = None
70
70
        try:
71
71
            TestOptions.current_test = "test_transport_set_to_sftp"
72
72
            stdout = self.capture('selftest --transport=sftp test_transport_set_to_sftp')
81
81
        finally:
82
82
            bzrlib.tests.default_transport = old_transport
83
83
            TestOptions.current_test = None
84
 
            TestCaseInTempDir.TEST_ROOT = old_root
 
84
            TestCaseWithMemoryTransport.TEST_ROOT = old_root
85
85
 
86
86
 
87
87
class TestRunBzr(ExternalBase):
107
107
        """bzr selftest --benchmark should not run the default test suite."""
108
108
        # We test this by passing a regression test name to --benchmark, which
109
109
        # should result in 0 rests run.
110
 
        old_root = TestCaseInTempDir.TEST_ROOT
 
110
        old_root = TestCaseWithMemoryTransport.TEST_ROOT
111
111
        try:
112
 
            TestCaseInTempDir.TEST_ROOT = None
 
112
            TestCaseWithMemoryTransport.TEST_ROOT = None
113
113
            out, err = self.run_bzr('selftest', '--benchmark', 'workingtree_implementations')
114
114
        finally:
115
 
            TestCaseInTempDir.TEST_ROOT = old_root
 
115
            TestCaseWithMemoryTransport.TEST_ROOT = old_root
116
116
        self.assertContainsRe(out, 'Ran 0 tests.*\n\nOK')
117
117
        self.assertEqual(
118
118
            'running tests...\ntests passed\n',