~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/tests/test_corners.py

test and paper over the fact that changing just the execute bit of a file in a
revision confuses loggerhead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
from turbogears import testutil
5
5
import cherrypy
6
6
 
7
 
class TestSurviveOverUpgrade(BasicTests):
 
7
class TestCornerCases(BasicTests):
8
8
 
9
 
    def test_upgrade(self):
 
9
    def test_survive_over_upgrade(self):
10
10
        self.createBranch()
11
11
 
12
12
        f = open(os.path.join(self.bzrbranch, 'myfilename'), 'w')
29
29
 
30
30
        testutil.create_request('/project/branch/changes')
31
31
        assert msg in cherrypy.response.body[0]
 
32
 
 
33
    def test_revision_only_changing_execute_bit(self):
 
34
        self.createBranch()
 
35
 
 
36
        f = open(os.path.join(self.bzrbranch, 'myfilename'), 'w')
 
37
        try:
 
38
            f.write("foo")
 
39
        finally:
 
40
            f.close()
 
41
        self.tree.add('myfilename')
 
42
        msg = 'a very exciting commit message'
 
43
        self.tree.commit(message=msg)
 
44
 
 
45
        os.chmod(os.path.join(self.bzrbranch, 'myfilename'), 0755)
 
46
 
 
47
        newrevid = self.tree.commit(message='make something executable')
 
48
 
 
49
        self.setUpLoggerhead()
 
50
 
 
51
 
 
52
        testutil.create_request('/project/branch/revision/'+newrevid)
 
53
        assert 'executable' in cherrypy.response.body[0]