66
66
class TestRepository(TestCaseWithRepository):
68
def assertFormatAttribute(self, attribute, allowed_values):
69
"""Assert that the format has an attribute 'attribute'."""
70
repo = self.make_repository('repo')
71
self.assertSubset([getattr(repo._format, attribute)], allowed_values)
68
73
def test_attribute__fetch_order(self):
69
74
"""Test the the _fetch_order attribute."""
70
tree = self.make_branch_and_tree('tree')
71
repo = tree.branch.repository
72
self.assertTrue(repo._format._fetch_order in ('topological', 'unordered'))
75
self.assertFormatAttribute('_fetch_order', ('topological', 'unordered'))
74
77
def test_attribute__fetch_uses_deltas(self):
75
78
"""Test the the _fetch_uses_deltas attribute."""
76
tree = self.make_branch_and_tree('tree')
77
repo = tree.branch.repository
78
self.assertTrue(repo._format._fetch_uses_deltas in (True, False))
79
self.assertFormatAttribute('_fetch_uses_deltas', (True, False))
80
81
def test_attribute_fast_deltas(self):
81
82
"""Test the format.fast_deltas attribute."""
82
tree = self.make_branch_and_tree('tree')
83
repo = tree.branch.repository
84
self.assertTrue(repo._format.fast_deltas in (True, False))
83
self.assertFormatAttribute('fast_deltas', (True, False))
86
85
def test_attribute__fetch_reconcile(self):
87
86
"""Test the the _fetch_reconcile attribute."""
88
tree = self.make_branch_and_tree('tree')
89
repo = tree.branch.repository
90
self.assertTrue(repo._format._fetch_reconcile in (True, False))
87
self.assertFormatAttribute('_fetch_reconcile', (True, False))
89
def test_attribute_format_pack_compresses(self):
90
self.assertFormatAttribute('pack_compresses', (True, False))
92
92
def test_attribute_inventories_store(self):
93
93
"""Test the existence of the inventories attribute."""