~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/tests/test_controllers.py

Merge Francesco's fix for bug #812583

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
        tree = self.make_branch_and_tree('.')
118
118
        self.build_tree_contents([('filename', '')])
119
119
        tree.add(['filename'], [file_id])
120
 
        for rev_id, text in rev_ids_texts:
 
120
        for rev_id, text, message in rev_ids_texts:
121
121
            self.build_tree_contents([('filename', text)])
122
 
            tree.commit(rev_id=rev_id, message='.')
 
122
            tree.commit(rev_id=rev_id, message=message)
123
123
        tree.branch.lock_read()
124
124
        self.addCleanup(tree.branch.unlock)
125
125
        branch_app = BranchWSGIApp(tree.branch, friendly_name='test_name')
126
126
        return AnnotateUI(branch_app, branch_app.get_history)
127
127
 
128
128
    def test_annotate_file(self):
129
 
        history = [('rev1', 'old\nold\n'), ('rev2', 'new\nold\n')]
 
129
        history = [('rev1', 'old\nold\n', '.'), ('rev2', 'new\nold\n', '.')]
130
130
        ann_ui = self.make_annotate_ui_for_file_history('file_id', history)
131
131
        # A lot of this state is set up by __call__, but we'll do it directly
132
132
        # here.
137
137
        self.assertEqual(2, len(annotated))
138
138
        self.assertEqual('2', annotated[1].change.revno)
139
139
        self.assertEqual('1', annotated[2].change.revno)
140
 
 
141
 
 
 
140
    
 
141
    def test_annotate_empty_comment(self):
 
142
        # Testing empty comment handling without breaking
 
143
        history = [('rev1', 'old\nold\n', '.'), ('rev2', 'new\nold\n', '')]
 
144
        ann_ui = self.make_annotate_ui_for_file_history('file_id', history)
 
145
        ann_ui.args = ['rev2']
 
146
        annotate_info = ann_ui.get_values('filename',
 
147
            kwargs={'file_id': 'file_id'}, headers={})
 
148
    
142
149
class TestFileDiffUI(BasicTests):
143
150
 
144
151
    def make_branch_app_for_filediff_ui(self):