~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Patch Queue Manager
  • Date: 2012-03-06 19:49:19 UTC
  • mfrom: (6472.2.6 use-bzr-controldir)
  • Revision ID: pqm@pqm.ubuntu.com-20120306194919-kt7mj6xmhifsgees
(jelmer) Use bzrlib.controldir for generic access to control directories,
 rather than bzrlib.bzrdir. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#import bzrlib specific imports here
28
28
from bzrlib import (
29
29
    branch,
30
 
    bzrdir,
31
30
    config,
 
31
    controldir,
32
32
    diff,
33
33
    errors,
34
34
    osutils,
115
115
 
116
116
def build_control_store(test):
117
117
    build_backing_branch(test, 'branch')
118
 
    b = bzrdir.BzrDir.open('branch')
 
118
    b = controldir.ControlDir.open('branch')
119
119
    return config.ControlStore(b)
120
120
config.test_store_builder_registry.register('control', build_control_store)
121
121
 
1142
1142
 
1143
1143
    def test_get_config(self):
1144
1144
        """The Branch.get_config method works properly"""
1145
 
        b = bzrdir.BzrDir.create_standalone_workingtree('.').branch
 
1145
        b = controldir.ControlDir.create_standalone_workingtree('.').branch
1146
1146
        my_config = b.get_config()
1147
1147
        self.assertIs(my_config.get_user_option('wacky'), None)
1148
1148
        my_config.set_user_option('wacky', 'unlikely')
2203
2203
        self.assertGetHook(remote_branch._get_config(), 'file', 'branch')
2204
2204
 
2205
2205
    def test_get_hook_remote_bzrdir(self):
2206
 
        remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree'))
 
2206
        remote_bzrdir = controldir.ControlDir.open(self.get_url('tree'))
2207
2207
        conf = remote_bzrdir._get_config()
2208
2208
        conf.set_option('remotedir', 'file')
2209
2209
        self.assertGetHook(conf, 'file', 'remotedir')
2231
2231
    def test_set_hook_remote_bzrdir(self):
2232
2232
        remote_branch = branch.Branch.open(self.get_url('tree'))
2233
2233
        self.addCleanup(remote_branch.lock_write().unlock)
2234
 
        remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree'))
 
2234
        remote_bzrdir = controldir.ControlDir.open(self.get_url('tree'))
2235
2235
        self.assertSetHook(remote_bzrdir._get_config(), 'file', 'remotedir')
2236
2236
 
2237
2237
    def assertLoadHook(self, expected_nb_calls, name, conf_class, *conf_args):
2254
2254
        self.assertLoadHook(1, 'file', remote.RemoteBranchConfig, remote_branch)
2255
2255
 
2256
2256
    def test_load_hook_remote_bzrdir(self):
2257
 
        remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree'))
 
2257
        remote_bzrdir = controldir.ControlDir.open(self.get_url('tree'))
2258
2258
        # The config file doesn't exist, set an option to force its creation
2259
2259
        conf = remote_bzrdir._get_config()
2260
2260
        conf.set_option('remotedir', 'file')
2285
2285
    def test_save_hook_remote_bzrdir(self):
2286
2286
        remote_branch = branch.Branch.open(self.get_url('tree'))
2287
2287
        self.addCleanup(remote_branch.lock_write().unlock)
2288
 
        remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree'))
 
2288
        remote_bzrdir = controldir.ControlDir.open(self.get_url('tree'))
2289
2289
        self.assertSaveHook(remote_bzrdir._get_config())
2290
2290
 
2291
2291