/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 bzrlib/tests/test_annotate.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-02 18:02:32 UTC
  • mto: This revision was merged to the branch mainline in revision 5826.
  • Revision ID: jelmer@samba.org-20110502180232-3ly7mm0w8fr6puf7
Factor out assertAnnotateEqualDiff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
260
260
            ('modify', ('file-id', e_text))])
261
261
        return builder
262
262
 
263
 
    def assertRepoAnnotate(self, expected, repo, file_id, revision_id):
264
 
        """Assert that the revision is properly annotated."""
265
 
        actual = list(repo.revision_tree(revision_id).annotate_iter(file_id))
 
263
    def assertAnnotateEqualDiff(self, actual, expected):
266
264
        if actual != expected:
267
265
            # Create an easier to understand diff when the lines don't actually
268
266
            # match
269
267
            self.assertEqualDiff(''.join('\t'.join(l) for l in expected),
270
268
                                 ''.join('\t'.join(l) for l in actual))
271
269
 
 
270
    def assertRepoAnnotate(self, expected, repo, file_id, revision_id):
 
271
        """Assert that the revision is properly annotated."""
 
272
        actual = list(repo.revision_tree(revision_id).annotate_iter(file_id))
 
273
        self.assertAnnotateEqualDiff(actual, expected)
 
274
 
272
275
    def test_annotate_duplicate_lines(self):
273
276
        # XXX: Should this be a per_repository test?
274
277
        builder = self.create_duplicate_lines_tree()