~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-03-03 06:02:49 UTC
  • mfrom: (5672.1.7 branch-revs-to-fetch)
  • Revision ID: pqm@pqm.ubuntu.com-20110303060249-l2zou9i59742nrqf
(spiv) Add Branch.heads_to_fetch API and HPSS request. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
            t = transport.get_transport(url)
141
141
            found_format = repository.RepositoryFormat.find_format(dir)
142
142
            self.failUnless(isinstance(found_format, format.__class__))
143
 
        check_format(weaverepo.RepositoryFormat7(), "bar")
 
143
        check_format(repository.format_registry.get_default(), "bar")
144
144
 
145
145
    def test_find_format_no_repository(self):
146
146
        dir = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
650
650
                                                        repo_b).__class__)
651
651
 
652
652
 
 
653
class TestRepositoryFormat1(knitrepo.RepositoryFormatKnit1):
 
654
 
 
655
    def get_format_string(self):
 
656
        return "Test Format 1"
 
657
 
 
658
 
 
659
class TestRepositoryFormat2(knitrepo.RepositoryFormatKnit1):
 
660
 
 
661
    def get_format_string(self):
 
662
        return "Test Format 2"
 
663
 
 
664
 
653
665
class TestRepositoryConverter(TestCaseWithTransport):
654
666
 
655
667
    def test_convert_empty(self):
 
668
        source_format = TestRepositoryFormat1()
 
669
        target_format = TestRepositoryFormat2()
 
670
        repository.format_registry.register(source_format)
 
671
        self.addCleanup(repository.format_registry.remove,
 
672
            source_format)
 
673
        repository.format_registry.register(target_format)
 
674
        self.addCleanup(repository.format_registry.remove,
 
675
            target_format)
656
676
        t = self.get_transport()
657
677
        t.mkdir('repository')
658
678
        repo_dir = bzrdir.BzrDirMetaFormat1().initialize('repository')
659
 
        repo = weaverepo.RepositoryFormat7().initialize(repo_dir)
660
 
        target_format = knitrepo.RepositoryFormatKnit1()
 
679
        repo = TestRepositoryFormat1().initialize(repo_dir)
661
680
        converter = repository.CopyConverter(target_format)
662
681
        pb = bzrlib.ui.ui_factory.nested_progress_bar()
663
682
        try:
668
687
        self.assertTrue(isinstance(target_format, repo._format.__class__))
669
688
 
670
689
 
671
 
class TestMisc(TestCase):
672
 
 
673
 
    def test_unescape_xml(self):
674
 
        """We get some kind of error when malformed entities are passed"""
675
 
        self.assertRaises(KeyError, repository._unescape_xml, 'foo&bar;')
676
 
 
677
 
 
678
690
class TestRepositoryFormatKnit3(TestCaseWithTransport):
679
691
 
680
692
    def test_attribute__fetch_order(self):