~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

Merge in bzrdir work to enable checkout improvements.

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
 
    def controlfile(self, filename, mode):
 
106
    def get_utf8(self, filename):
101
107
        if filename != 'email':
102
108
            raise NotImplementedError
103
109
        if self.email is not None:
541
547
        my_config = config.BranchConfig(branch)
542
548
        self.assertEqual("Robert Collins <robertc@example.net>",
543
549
                         my_config._get_user_id())
544
 
        branch.email = "John"
 
550
        branch.control_files.email = "John"
545
551
        self.assertEqual("John", my_config._get_user_id())
546
552
 
547
553
    def test_not_set_in_branch(self):
548
554
        branch = FakeBranch()
549
555
        my_config = config.BranchConfig(branch)
550
 
        branch.email = None
 
556
        branch.control_files.email = None
551
557
        config_file = StringIO(sample_config_text)
552
558
        (my_config._get_location_config().
553
559
            _get_global_config()._get_parser(config_file))
554
560
        self.assertEqual("Robert Collins <robertc@example.com>",
555
561
                         my_config._get_user_id())
556
 
        branch.email = "John"
 
562
        branch.control_files.email = "John"
557
563
        self.assertEqual("John", my_config._get_user_id())
558
564
 
559
565
    def test_BZREMAIL_OVERRIDES(self):