694
694
'Value "not-a-bool" is not valid for "append_revisions_only"',
695
695
self.warnings[0])
697
def test_use_fresh_values(self):
698
copy = _mod_branch.Branch.open(self.branch.base)
701
copy.get_config_stack().set('foo', 'bar')
704
self.assertFalse(self.branch.is_locked())
705
result = self.branch.get_config_stack().get('foo')
706
# Bug: https://bugs.launchpad.net/bzr/+bug/948339
707
self.expectFailure('Unlocked branches cache their configs',
708
self.assertEqual, 'bar', result)
710
def test_set_from_config_get_from_config_stack(self):
711
self.branch.lock_write()
712
self.addCleanup(self.branch.unlock)
713
self.branch.get_config().set_user_option('foo', 'bar')
714
result = self.branch.get_config_stack().get('foo')
715
# https://bugs.launchpad.net/bzr/+bug/948344
716
self.expectFailure('BranchStack uses cache after set_user_option',
717
self.assertEqual, 'bar', result)
719
def test_set_from_config_stack_get_from_config(self):
720
self.branch.lock_write()
721
self.addCleanup(self.branch.unlock)
722
self.branch.get_config_stack().set('foo', 'bar')
723
self.assertEqual('bar',
724
self.branch.get_config().get_user_option('foo'))
726
def test_set_delays_write(self):
727
self.branch.lock_write()
728
self.addCleanup(self.branch.unlock)
729
self.branch.get_config_stack().set('foo', 'bar')
730
copy = _mod_branch.Branch.open(self.branch.base)
731
result = copy.get_config_stack().get('foo')
732
# Bug: https://bugs.launchpad.net/bzr/+bug/948339
733
self.expectFailure("Config writes are not cached.", self.assertIs,
698
737
class TestPullResult(tests.TestCase):