~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2010-02-09 17:15:17 UTC
  • mto: (5029.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5030.
  • Revision ID: v.ladeuil+lp@free.fr-20100209171517-1wzz1nh3d3nhnkbu
Move ReadonlyServer to bzrlib.tests.readonly

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Black box tests for the upgrade ui."""
18
18
 
19
 
import os
20
 
 
21
19
from bzrlib import (
22
20
    bzrdir,
23
21
    repository,
24
 
    ui,
25
22
    )
26
23
from bzrlib.tests import (
27
24
    TestCaseInTempDir,
28
25
    TestCaseWithTransport,
29
 
    TestUIFactory,
30
26
    )
31
27
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
32
28
from bzrlib.transport import get_transport
39
35
 
40
36
    def setUp(self):
41
37
        super(TestWithUpgradableBranches, self).setUp()
42
 
        self.old_format = bzrdir.BzrDirFormat.get_default_format()
43
 
        self.old_ui_factory = ui.ui_factory
44
 
        self.addCleanup(self.restoreDefaults)
45
 
        ui.ui_factory = TestUIFactory()
46
 
 
47
 
    def restoreDefaults(self):
48
 
        ui.ui_factory = self.old_ui_factory
49
 
        bzrdir.BzrDirFormat._set_default_format(self.old_format)
 
38
        self.addCleanup(bzrdir.BzrDirFormat._set_default_format,
 
39
                        bzrdir.BzrDirFormat.get_default_format())
50
40
 
51
41
    def make_current_format_branch_and_checkout(self):
52
42
        current_tree = self.make_branch_and_tree('current_format_branch',
158
148
class SFTPTests(TestCaseWithSFTPServer):
159
149
    """Tests for upgrade over sftp."""
160
150
 
161
 
    def setUp(self):
162
 
        super(SFTPTests, self).setUp()
163
 
        self.old_ui_factory = ui.ui_factory
164
 
        self.addCleanup(self.restoreDefaults)
165
 
 
166
 
        ui.ui_factory = TestUIFactory()
167
 
 
168
 
    def restoreDefaults(self):
169
 
        ui.ui_factory = self.old_ui_factory
170
 
 
171
151
    def test_upgrade_url(self):
172
152
        self.run_bzr('init --format=weave')
173
153
        t = get_transport(self.get_url())