~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2012, 2016 Canonical Ltd
2
2
# Authors: Robert Collins <robert.collins@canonical.com>
3
3
#          and others
4
4
#
92
92
 
93
93
class TestCaseWithRepository(TestCaseWithControlDir):
94
94
 
95
 
    def make_repository(self, relpath, shared=False, format=None):
96
 
        if format is None:
 
95
    def get_default_format(self):
 
96
        format = self.repository_format._matchingbzrdir
 
97
        self.assertEqual(format.repository_format, self.repository_format)
 
98
        return format
 
99
 
 
100
    def make_repository(self, relpath, shared=None, format=None):
 
101
        format = self.resolve_format(format)
 
102
        repo = super(TestCaseWithRepository, self).make_repository(
 
103
            relpath, shared=shared, format=format)
 
104
        if format is None or format.repository_format is self.repository_format:
97
105
            # 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
106
            if getattr(self, "repository_to_test_repository", None):
102
107
                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)
 
108
        return repo
107
109
 
108
110
 
109
111
def load_tests(standard_tests, module, loader):
114
116
        'test_check',
115
117
        'test_commit_builder',
116
118
        'test_fetch',
117
 
        'test_fileid_involved',
118
119
        'test_file_graph',
119
120
        'test_get_parent_map',
120
121
        'test_has_same_location',
121
122
        'test_has_revisions',
122
 
        'test_iter_reverse_revision_history',
123
123
        'test_locking',
124
124
        'test_pack',
125
125
        'test_reconcile',
126
126
        'test_refresh_data',
127
127
        'test_repository',
128
128
        'test_revision',
 
129
        'test_signatures',
129
130
        'test_statistics',
130
131
        'test_write_group',
131
132
        ]