/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 breezy/tests/test_repository.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-05 23:34:07 UTC
  • mto: (6653.3.3 bzrwt)
  • mto: This revision was merged to the branch mainline in revision 6667.
  • Revision ID: jelmer@jelmer.uk-20170605233407-ys037zw4q7wwwwpl
Fix imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
            dir = format._matchingbzrdir.initialize(url)
140
140
            format.initialize(dir)
141
141
            t = transport.get_transport_from_path(url)
142
 
            found_format = repository.RepositoryFormatMetaDir.find_format(dir)
 
142
            found_format = bzrrepository.RepositoryFormatMetaDir.find_format(dir)
143
143
            self.assertIsInstance(found_format, format.__class__)
144
144
        check_format(repository.format_registry.get_default(), "bar")
145
145
 
146
146
    def test_find_format_no_repository(self):
147
147
        dir = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
148
148
        self.assertRaises(errors.NoRepositoryPresent,
149
 
                          repository.RepositoryFormatMetaDir.find_format,
 
149
                          bzrrepository.RepositoryFormatMetaDir.find_format,
150
150
                          dir)
151
151
 
152
152
    def test_from_string(self):
162
162
        dir = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
163
163
        SampleRepositoryFormat().initialize(dir)
164
164
        self.assertRaises(UnknownFormatError,
165
 
                          repository.RepositoryFormatMetaDir.find_format,
 
165
                          bzrrepository.RepositoryFormatMetaDir.find_format,
166
166
                          dir)
167
167
 
168
168
    def test_find_format_with_features(self):
169
169
        tree = self.make_branch_and_tree('.', format='2a')
170
170
        tree.branch.repository.update_feature_flags({"name": "necessity"})
171
 
        found_format = repository.RepositoryFormatMetaDir.find_format(tree.bzrdir)
172
 
        self.assertIsInstance(found_format, repository.RepositoryFormatMetaDir)
 
171
        found_format = bzrrepository.RepositoryFormatMetaDir.find_format(tree.bzrdir)
 
172
        self.assertIsInstance(found_format, bzrrepository.RepositoryFormatMetaDir)
173
173
        self.assertEqual(found_format.features.get("name"), "necessity")
174
174
        self.assertRaises(errors.MissingFeature, found_format.check_support_status,
175
175
            True)
176
 
        self.addCleanup(repository.RepositoryFormatMetaDir.unregister_feature,
 
176
        self.addCleanup(bzrrepository.RepositoryFormatMetaDir.unregister_feature,
177
177
            "name")
178
 
        repository.RepositoryFormatMetaDir.register_feature("name")
 
178
        bzrrepository.RepositoryFormatMetaDir.register_feature("name")
179
179
        found_format.check_support_status(True)
180
180
 
181
181
 
1705
1705
 
1706
1706
    def test_open_with_present_feature(self):
1707
1707
        self.addCleanup(
1708
 
            repository.RepositoryFormatMetaDir.unregister_feature,
 
1708
            bzrrepository.RepositoryFormatMetaDir.unregister_feature,
1709
1709
            "makes-cheese-sandwich")
1710
 
        repository.RepositoryFormatMetaDir.register_feature(
 
1710
        bzrrepository.RepositoryFormatMetaDir.register_feature(
1711
1711
            "makes-cheese-sandwich")
1712
1712
        repo = self.make_repository('.')
1713
1713
        repo.lock_write()