~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-02-20 12:19:29 UTC
  • mfrom: (6437.23.11 2.5)
  • mto: (6581.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6582.
  • Revision ID: jelmer@samba.org-20120220121929-7ni2psvjoatm1yp4
Merge bzr/2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
"""
26
26
 
27
27
from bzrlib import (
 
28
    bzrdir,
28
29
    repository,
29
30
    )
30
31
from bzrlib.remote import RemoteRepositoryFormat
92
93
 
93
94
class TestCaseWithRepository(TestCaseWithControlDir):
94
95
 
95
 
    def make_repository(self, relpath, shared=False, format=None):
96
 
        if format is None:
 
96
    def get_default_format(self):
 
97
        format = self.repository_format._matchingbzrdir
 
98
        self.assertEquals(format.repository_format, self.repository_format)
 
99
        return format
 
100
 
 
101
    def make_repository(self, relpath, shared=None, format=None):
 
102
        format = self.resolve_format(format)
 
103
        repo = super(TestCaseWithRepository, self).make_repository(
 
104
            relpath, shared=shared, format=format)
 
105
        if format is None or format.repository_format is self.repository_format:
97
106
            # Create a repository of the type we are trying to test.
98
 
            made_control = self.make_bzrdir(relpath)
99
 
            repo = self.repository_format.initialize(made_control,
100
 
                    shared=shared)
101
107
            if getattr(self, "repository_to_test_repository", None):
102
108
                repo = self.repository_to_test_repository(repo)
103
 
            return repo
104
 
        else:
105
 
            return super(TestCaseWithRepository, self).make_repository(
106
 
                relpath, shared=shared, format=format)
 
109
        return repo
107
110
 
108
111
 
109
112
def load_tests(standard_tests, module, loader):
114
117
        'test_check',
115
118
        'test_commit_builder',
116
119
        'test_fetch',
117
 
        'test_fileid_involved',
118
120
        'test_file_graph',
119
121
        'test_get_parent_map',
120
122
        'test_has_same_location',
121
123
        'test_has_revisions',
122
124
        'test_iter_reverse_revision_history',
123
125
        'test_locking',
124
 
        'test_merge_directive',
125
126
        'test_pack',
126
127
        'test_reconcile',
127
128
        'test_refresh_data',
128
129
        'test_repository',
129
130
        'test_revision',
 
131
        'test_signatures',
130
132
        'test_statistics',
131
133
        'test_write_group',
132
134
        ]