~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testconfig.py

Disable inheritance for getting at LockableFiles, rather use composition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
 
96
96
    def __init__(self):
97
97
        self.base = "http://example.com/branches/demo"
 
98
        self.control_files = FakeControlFiles()
 
99
 
 
100
 
 
101
class FakeControlFiles(object):
 
102
 
 
103
    def __init__(self):
98
104
        self.email = 'Robert Collins <robertc@example.net>\n'
99
105
 
100
106
    def controlfile(self, filename, mode):
494
500
        my_config = config.BranchConfig(branch)
495
501
        self.assertEqual("Robert Collins <robertc@example.net>",
496
502
                         my_config._get_user_id())
497
 
        branch.email = "John"
 
503
        branch.control_files.email = "John"
498
504
        self.assertEqual("John", my_config._get_user_id())
499
505
 
500
506
    def test_not_set_in_branch(self):
501
507
        branch = FakeBranch()
502
508
        my_config = config.BranchConfig(branch)
503
 
        branch.email = None
 
509
        branch.control_files.email = None
504
510
        config_file = StringIO(sample_config_text)
505
511
        (my_config._get_location_config().
506
512
            _get_global_config()._get_parser(config_file))
507
513
        self.assertEqual("Robert Collins <robertc@example.com>",
508
514
                         my_config._get_user_id())
509
 
        branch.email = "John"
 
515
        branch.control_files.email = "John"
510
516
        self.assertEqual("John", my_config._get_user_id())
511
517
 
512
518
    def test_BZREMAIL_OVERRIDES(self):