515
515
self.assertTrue(hasattr(params, 'to_branch'))
516
516
self.assertTrue(hasattr(params, 'revision_id'))
519
class TestBranchOptions(tests.TestCaseWithTransport):
522
super(TestBranchOptions, self).setUp()
523
self.branch = self.make_branch('.')
524
self.config = self.branch.get_config()
526
def check_append_revisions_only(self, expected_value, value=None):
527
"""Set append_revisions_only in config and check its interpretation."""
528
if value is not None:
529
self.config.set_user_option('append_revisions_only', value)
530
self.assertEqual(expected_value,
531
self.branch._get_append_revisions_only())
533
def test_valid_append_revisions_only(self):
534
self.assertEquals(None,
535
self.config.get_user_option('append_revisions_only'))
536
self.check_append_revisions_only(None)
537
self.check_append_revisions_only(False, 'False')
538
self.check_append_revisions_only(True, 'True')
539
# The following values will cause compatibility problems on projects
540
# using older bzr versions (<2.2) but are accepted
541
self.check_append_revisions_only(False, 'false')
542
self.check_append_revisions_only(True, 'true')
544
def test_invalid_append_revisions_only(self):
545
"""Ensure warning is noted on invalid settings"""
548
self.warnings.append(args[0] % args[1:])
549
self.overrideAttr(trace, 'warning', warning)
550
self.check_append_revisions_only(None, 'not-a-bool')
551
self.assertLength(1, self.warnings)
553
'Value "not-a-bool" is not a boolean for "append_revisions_only"',
518
557
class TestPullResult(tests.TestCase):
520
559
def test_pull_result_to_int(self):