/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_repository.py

  • Committer: Jonathan Lange
  • Date: 2009-06-26 04:59:19 UTC
  • mto: (4484.1.1 bring-1.16.1-back)
  • mto: This revision was merged to the branch mainline in revision 4485.
  • Revision ID: jml@canonical.com-20090626045919-gn8u37kfbpylw6un
Cherrypick bzr.dev 4470, resolving conflicts.

Fixes bug 365615 -- autopack on 2a branches raises AbsentContentFactory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 
66
66
class TestRepository(TestCaseWithRepository):
67
67
 
 
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)
 
72
 
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'))
73
76
 
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))
79
80
 
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))
85
84
 
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))
 
88
 
 
89
    def test_attribute_format_pack_compresses(self):
 
90
        self.assertFormatAttribute('pack_compresses', (True, False))
91
91
 
92
92
    def test_attribute_inventories_store(self):
93
93
        """Test the existence of the inventories attribute."""