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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-07-03 03:20:44 UTC
  • mfrom: (7018.3.10 git-fixes)
  • Revision ID: breezy.the.bot@gmail.com-20180703032044-t5a5w5y0tmzrbezc
Port a few more bits of the git plugin to python 3.

Merged from https://code.launchpad.net/~jelmer/brz/git-fixes2/+merge/348803

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
        GitRepo.init(self.test_dir)
106
106
 
107
107
        repo = Repository.open('.')
108
 
        self.assertRaises(errors.NoSuchRevision, repo.get_revision, "bla")
 
108
        self.assertRaises(errors.NoSuchRevision, repo.get_revision, b"bla")
109
109
 
110
110
    def simple_commit(self):
111
111
        # Create a git repository with some interesting files in a revision.
113
113
        builder = tests.GitBranchBuilder()
114
114
        builder.set_file(b'data', b'text\n', False)
115
115
        builder.set_file(b'executable', b'content', True)
116
 
        builder.set_link(b'link', b'broken')
 
116
        builder.set_symlink(b'link', b'broken')
117
117
        builder.set_file(b'subdir/subfile', b'subdir text\n', False)
118
118
        commit_handle = builder.commit(b'Joe Foo <joe@foo.com>', b'message',
119
119
            timestamp=1205433193)
205
205
        self.assertFalse(branch.repository.has_signature_for_revision_id(revid))
206
206
        try:
207
207
            breezy.gpg.GPGStrategy = breezy.gpg.LoopbackGPGStrategy
208
 
            conf = config.MemoryStack('''
 
208
            conf = config.MemoryStack(b'''
209
209
create_signatures=always
210
210
''')
211
211
            revid2 = wt.commit(config=conf, message="base", allow_pointless=True)
212
212
            def sign(text):
213
213
                return breezy.gpg.LoopbackGPGStrategy(None).sign(text)
214
 
            self.assertIsInstance(branch.repository.get_signature_text(revid2), str)
 
214
            self.assertIsInstance(branch.repository.get_signature_text(revid2), bytes)
215
215
        finally:
216
216
            breezy.gpg.GPGStrategy = oldstrategy
217
217