/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 breezy/tests/test_patches.py

  • Committer: Breezy landing bot
  • Author(s): Martin
  • Date: 2017-05-26 09:35:13 UTC
  • mfrom: (6634.2.2 next_up_next)
  • Revision ID: breezy.the.bot@gmail.com-20170526093513-funr1gww70uc4mag
Make iterator objects and use of next Python 3 compatible

Merged from https://code.launchpad.net/~gz/brz/next_up_next/+merge/324586

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
        self.compare_parsed(patchtext)
212
212
 
213
213
    def testLineLookup(self):
214
 
        import sys
215
214
        """Make sure we can accurately look up mod line from orig"""
216
215
        patch = parse_patch(self.datafile("diff"))
217
216
        orig = list(self.datafile("orig"))
227
226
        for hunk in patch.hunks:
228
227
            for line in hunk.lines:
229
228
                if isinstance(line, RemoveLine):
230
 
                    next = rem_iter.next()
231
 
                    if line.contents != next:
232
 
                        sys.stdout.write(" orig:%spatch:%s" % (next,
233
 
                                         line.contents))
234
 
                    self.assertEqual(line.contents, next)
235
 
        self.assertRaises(StopIteration, rem_iter.next)
 
229
                    self.assertEqual(line.contents, next(rem_iter))
 
230
        self.assertRaises(StopIteration, next, rem_iter)
236
231
 
237
232
    def testPatching(self):
238
233
        """Test a few patch files, and make sure they work."""