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

Merge thin-pack work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for interfacing with a Git Repository"""
18
18
 
19
 
import dulwich as git
20
 
import os
21
 
 
22
19
from bzrlib import (
23
20
    errors,
24
21
    inventory,
25
22
    revision,
26
23
    )
27
 
from bzrlib.repository import (
28
 
    Repository,
29
 
    )
 
24
from bzrlib.repository import Repository
30
25
 
31
26
from bzrlib.plugins.git import (
32
27
    dir,
33
28
    repository,
34
29
    tests,
35
30
    )
36
 
from bzrlib.plugins.git.mapping import (
37
 
    default_mapping,
38
 
    )
 
31
from bzrlib.plugins.git.mapping import default_mapping
 
32
 
 
33
import dulwich as git
39
34
 
40
35
class TestGitRepositoryFeatures(tests.TestCaseInTempDir):
41
36
    """Feature tests for GitRepository."""
149
144
        self.assertEquals(False, self.git_repo.has_signature_for_revision_id(revision.NULL_REVISION))
150
145
 
151
146
    def test_all_revision_ids_none(self):
152
 
        self.assertEquals(set([revision.NULL_REVISION]), self.git_repo.all_revision_ids())
 
147
        self.assertEquals(set(), self.git_repo.all_revision_ids())
153
148
 
154
149
    def test_get_ancestry_null(self):
155
 
        self.assertEquals([None, revision.NULL_REVISION], self.git_repo.get_ancestry(revision.NULL_REVISION))
 
150
        self.assertEquals([None], self.git_repo.get_ancestry(revision.NULL_REVISION))
156
151
 
157
152
    def assertIsNullInventory(self, inv):
158
153
        self.assertEqual(inv.root, None)
185
180
 
186
181
    def test_get_format_description(self):
187
182
        self.assertEquals("Git Repository", self.format.get_format_description())
188
 
 
189
 
 
190
 
class RevisionGistImportTests(tests.TestCaseWithTransport):
191
 
 
192
 
    def setUp(self):
193
 
        tests.TestCaseWithTransport.setUp(self)
194
 
        self.git_path = os.path.join(self.test_dir, "git")
195
 
        os.mkdir(self.git_path)
196
 
        git.repo.Repo.create(self.git_path)
197
 
        self.git_repo = Repository.open(self.git_path)
198
 
        self.bzr_tree = self.make_branch_and_tree("bzr")
199
 
 
200
 
    def import_rev(self, revid, parent_lookup=None):
201
 
        return self.git_repo.import_revision_gist(
202
 
            self.bzr_tree.branch.repository, revid, parent_lookup)
203
 
 
204
 
    def test_pointless(self):
205
 
        revid = self.bzr_tree.commit("pointless", timestamp=1205433193,
206
 
                  committer="Jelmer Vernooij <jelmer@samba.org>")
207
 
        self.assertEquals("2caa8094a5b794961cd9bf582e3e2bb090db0b14", 
208
 
                self.import_rev(revid))
209
 
        self.assertEquals("2caa8094a5b794961cd9bf582e3e2bb090db0b14", 
210
 
                self.import_rev(revid))