~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/tests/test_simple.py

test annotate too

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
            self.bzrbranch, force_new_tree=True)
35
35
        tree = branch.bzrdir.open_workingtree()
36
36
        f = open(os.path.join(self.bzrbranch, 'file'), 'w')
 
37
        self.filecontents = 'some\nmultiline\ndata'
37
38
        try:
38
 
            f.write('data')
 
39
            f.write(self.filecontents)
39
40
        finally:
40
41
            f.close()
41
42
        tree.add('file')
 
43
        self.fileid = tree.path2id('file')
42
44
        self.msg = 'a very exciting commit message'
43
 
        tree.commit(message=self.msg)
 
45
        self.revid = tree.commit(message=self.msg)
44
46
 
45
47
        ini = config_template%self.bzrbranch
46
48
 
67
69
    def test_changes(self):
68
70
        testutil.create_request('/project/branch/changes')
69
71
        assert self.msg in cherrypy.response.body[0]
 
72
 
 
73
    def test_annotate(self):
 
74
        testutil.create_request('/project/branch/annotate?'
 
75
                                + 'file_id='+self.fileid)
 
76
        for line in self.filecontents.splitlines():
 
77
            assert line in cherrypy.response.body[0]