summaryrefslogtreecommitdiff
path: root/bzrlib/tests/per_branch/test_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'bzrlib/tests/per_branch/test_config.py')
-rw-r--r--bzrlib/tests/per_branch/test_config.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/bzrlib/tests/per_branch/test_config.py b/bzrlib/tests/per_branch/test_config.py
new file mode 100644
index 0000000..35044e3
--- /dev/null
+++ b/bzrlib/tests/per_branch/test_config.py
@@ -0,0 +1,46 @@
+# Copyright (C) 2010 Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+"""Tests for branch.get_config behaviour."""
+
+from bzrlib import (
+ branch,
+ errors,
+ remote,
+ tests,
+ )
+from bzrlib.tests import per_branch
+
+
+class TestGetConfig(per_branch.TestCaseWithBranch):
+
+ def test_set_user_option_with_dict(self):
+ b = self.make_branch('b')
+ config = b.get_config()
+ value_dict = {
+ 'ascii': 'abcd', u'unicode \N{WATCH}': u'foo \N{INTERROBANG}'}
+ config.set_user_option('name', value_dict.copy())
+ self.assertEqual(value_dict, config.get_user_option('name'))
+
+ def test_set_submit_branch(self):
+ # Make sure setting a config option persists on disk
+ b = self.make_branch('.')
+ b.set_submit_branch('foo')
+ # Refresh the branch
+ b = branch.Branch.open('.')
+ self.assertEquals('foo', b.get_submit_branch())
+
+