/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to loggerhead/tests/test_corners.py

  • Committer: Colin Watson
  • Date: 2019-09-19 08:10:36 UTC
  • mfrom: (491.2.62 breezy)
  • Revision ID: cjwatson@canonical.com-20190919081036-q1symc2h2iedtlh3
[r=cjwatson] Switch loggerhead over to using the Breezy rather than Bazaar APIs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from __future__ import absolute_import
 
2
 
1
3
import os
2
4
 
3
 
from loggerhead.tests.test_simple import BasicTests
 
5
from .test_simple import BasicTests
4
6
 
5
7
 
6
8
class TestCornerCases(BasicTests):
26
28
        self.addFileAndCommit('myfilename', msg)
27
29
 
28
30
        # Make a commit that changes the execute bit of 'myfilename'.
29
 
        os.chmod('myfilename', 0755)
 
31
        os.chmod('myfilename', 0o755)
30
32
        newrevid = self.tree.commit(message='make something executable')
31
33
 
32
34
        # Check that it didn't break things.
33
35
        app = self.setUpLoggerhead()
34
 
        res = app.get('/revision/'+newrevid)
35
 
        res.mustcontain('executable')
 
36
        res = app.get('/revision/'+newrevid.decode('utf-8'))
 
37
        res.mustcontain(b'executable')
36
38
 
37
39
    def test_revision_escapes_commit_message(self):
38
40
        """XXX."""
39
41
        self.createBranch()
40
42
 
41
 
        msg = '<b>hi</b>'
 
43
        msg = b'<b>hi</b>'
42
44
        self.addFileAndCommit('myfilename', msg)
43
45
        app = self.setUpLoggerhead()
44
46
        res = app.get('/revision/1')