/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 breezy/tests/test_config.py

  • Committer: Jelmer Vernooij
  • Date: 2018-04-02 00:52:27 UTC
  • mfrom: (6939 work)
  • mto: This revision was merged to the branch mainline in revision 7274.
  • Revision ID: jelmer@jelmer.uk-20180402005227-pecflp1mvdjrjqd6
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    controldir,
31
31
    diff,
32
32
    errors,
 
33
    lock,
33
34
    osutils,
34
35
    mail_client,
35
36
    ui,
339
340
        return config.TransportConfig(self._transport, 'branch.conf')
340
341
 
341
342
    def lock_write(self):
342
 
        pass
 
343
        return lock.LogicalLockResult(self.unlock)
343
344
 
344
345
    def unlock(self):
345
346
        pass
764
765
        return c
765
766
 
766
767
    def test_dont_cross_unrelated_section(self):
767
 
        c = self.get_config('/another/branch/path','''
 
768
        c = self.get_config('/another/branch/path', '''
768
769
[/one/branch/path]
769
770
foo = hello
770
771
bar = {foo}/2
776
777
                          c.get_user_option, 'bar', expand=True)
777
778
 
778
779
    def test_cross_related_sections(self):
779
 
        c = self.get_config('/project/branch/path','''
 
780
        c = self.get_config('/project/branch/path', '''
780
781
[/project]
781
782
foo = qu
782
783
 
1912
1913
        # caused by the differences in implementations betwen
1913
1914
        # SmartServerBzrDirRequestConfigFile (in smart/bzrdir.py) and
1914
1915
        # SmartServerBranchGetConfigFile (in smart/branch.py)
1915
 
        self.assertLoadHook(2 ,'file', remote.RemoteBzrDirConfig, remote_bzrdir)
 
1916
        self.assertLoadHook(2, 'file', remote.RemoteBzrDirConfig, remote_bzrdir)
1916
1917
 
1917
1918
    def assertSaveHook(self, conf):
1918
1919
        calls = []
3796
3797
        return c
3797
3798
 
3798
3799
    def test_dont_cross_unrelated_section(self):
3799
 
        c = self.get_config('/another/branch/path','''
 
3800
        c = self.get_config('/another/branch/path', '''
3800
3801
[/one/branch/path]
3801
3802
foo = hello
3802
3803
bar = {foo}/2
3808
3809
                          c.get, 'bar', expand=True)
3809
3810
 
3810
3811
    def test_cross_related_sections(self):
3811
 
        c = self.get_config('/project/branch/path','''
 
3812
        c = self.get_config('/project/branch/path', '''
3812
3813
[/project]
3813
3814
foo = qu
3814
3815
 
4331
4332
                              conf, 'http', host='bar.org', path='/dir2')
4332
4333
        # matching subdir
4333
4334
        self._got_user_passwd('jim', 'jimpass',
4334
 
                              conf, 'http', host='bar.org',path='/dir1/subdir')
 
4335
                              conf, 'http', host='bar.org', path='/dir1/subdir')
4335
4336
 
4336
4337
    def test_credentials_for_user(self):
4337
4338
        conf = config.AuthenticationConfig(_file=BytesIO(b"""
4503
4504
                          conf.get_password('ssh', 'bar.org', user='jim'))
4504
4505
        self.assertContainsRe(
4505
4506
            self.get_log(),
4506
 
            'password ignored in section \[ssh with password\]')
 
4507
            'password ignored in section \\[ssh with password\\]')
4507
4508
 
4508
4509
    def test_ssh_without_password_doesnt_emit_warning(self):
4509
4510
        conf = config.AuthenticationConfig(_file=BytesIO(b"""
4523
4524
        # providing "user".
4524
4525
        self.assertNotContainsRe(
4525
4526
            self.get_log(),
4526
 
            'password ignored in section \[ssh with password\]')
 
4527
            'password ignored in section \\[ssh with password\\]')
4527
4528
 
4528
4529
    def test_uses_fallback_stores(self):
4529
4530
        self.overrideAttr(config, 'credential_store_registry',