~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Vincent Ladeuil
  • Date: 2012-03-13 16:28:30 UTC
  • mto: This revision was merged to the branch mainline in revision 6512.
  • Revision ID: v.ladeuil+lp@free.fr-20120313162830-83ekrd4ghqru0whh
Save branch config options only during the final unlock

Show diffs side-by-side

added added

removed removed

Lines of Context:
2872
2872
        store.save()
2873
2873
        self.assertEquals(False, self.has_store(store))
2874
2874
 
 
2875
    def test_mutable_section_shared(self):
 
2876
        store = self.get_store(self)
 
2877
        store._load_from_string('foo=bar\n')
 
2878
        # FIXME: There should be a better way than relying on the test
 
2879
        # parametrization to identify branch.conf -- vila 2011-0526
 
2880
        if self.store_id in ('branch', 'remote_branch'):
 
2881
            # branch stores requires write locked branches
 
2882
            self.addCleanup(store.branch.lock_write().unlock)
 
2883
        section1 = store.get_mutable_section(None)
 
2884
        section2 = store.get_mutable_section(None)
 
2885
        # If we get different sections, different callers won't share the
 
2886
        # modification
 
2887
        self.assertIs(section1, section2)
 
2888
 
2875
2889
    def test_save_emptied_succeeds(self):
2876
2890
        store = self.get_store(self)
2877
2891
        store._load_from_string('foo=bar\n')