/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_mapping.py

  • Committer: Jelmer Vernooij
  • Date: 2018-04-02 17:32:04 UTC
  • mto: (0.414.1 work)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180402173204-8u16s4jwz3o39fql
Add support for the mergetag property in git.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from dulwich.objects import (
31
31
    Blob,
32
32
    Commit,
 
33
    Tag,
33
34
    Tree,
34
35
    parse_timezone,
35
36
    )
 
37
from dulwich.tests.utils import (
 
38
    make_object,
 
39
    )
36
40
 
37
41
from .. import tests
38
42
from ..errors import UnknownCommitExtra
196
200
        self.assertRaises(UnknownCommitExtra, mapping.import_commit, c,
197
201
            mapping.revision_id_foreign_to_bzr)
198
202
 
 
203
    def test_mergetag(self):
 
204
        c = Commit()
 
205
        c.tree = "cc9462f7f8263ef5adfbeff2fb936bb36b504cba"
 
206
        c.message = "Some message"
 
207
        c.committer = "Committer"
 
208
        c.commit_time = 4
 
209
        c.author_time = 5
 
210
        c.commit_timezone = 60 * 5
 
211
        c.author_timezone = 60 * 3
 
212
        c.author = "Author"
 
213
        tag = make_object(Tag,
 
214
                tagger=b'Jelmer Vernooij <jelmer@samba.org>',
 
215
                name=b'0.1', message=None,
 
216
                object=(Blob, b'd80c186a03f423a81b39df39dc87fd269736ca86'),
 
217
                tag_time=423423423, tag_timezone=0)
 
218
        c.mergetag = [tag]
 
219
        mapping = BzrGitMappingv1()
 
220
        rev, roundtrip_revid, verifiers = mapping.import_commit(
 
221
                c, mapping.revision_id_foreign_to_bzr)
 
222
        self.assertEqual(rev.properties['git-mergetag-0'], tag.as_raw_string())
 
223
 
199
224
 
200
225
class RoundtripRevisionsFromBazaar(tests.TestCase):
201
226