~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_delta.py

  • Committer: Robert Collins
  • Date: 2010-04-08 04:34:03 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5139.
  • Revision ID: robertc@robertcollins.net-20100408043403-56z0d07vdqrx7f3t
Update bugfix for 528114 to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
221
221
 
222
222
    def show_string(self, delta, *args,  **kwargs):
223
223
        to_file = StringIO()
224
 
        delta.show(to_file, *args, **kwargs)
 
224
        _mod_delta.report_delta(to_file, delta, *args, **kwargs)
225
225
        return to_file.getvalue()
226
226
 
227
227
    def test_kind_change(self):
307
307
    def test_delta_show_short_status_no_filter(self):
308
308
        d, long_status, short_status = self._get_delta()
309
309
        out = StringIO()
310
 
        d.show(out, short_status=True)
 
310
        _mod_delta.report_delta(out, d, short_status=True)
311
311
        self.assertEquals(short_status, out.getvalue())
312
312
 
313
313
    def test_delta_show_long_status_no_filter(self):
314
314
        d, long_status, short_status = self._get_delta()
315
315
        out = StringIO()
316
 
        d.show(out, short_status=False)
 
316
        _mod_delta.report_delta(out, d, short_status=False)
317
317
        self.assertEquals(long_status, out.getvalue())
318
318
 
319
319
    def test_delta_show_no_filter(self):
321
321
        out = StringIO()
322
322
        def not_a_filter(path, file_id):
323
323
            return True
324
 
        d.show(out, short_status=True, filter=not_a_filter)
 
324
        _mod_delta.report_delta(out, d, short_status=True, filter=not_a_filter)
325
325
        self.assertEquals(short_status, out.getvalue())
326
326
 
327
327
    def test_delta_show_short_status_single_file_filter(self):
329
329
        out = StringIO()
330
330
        def only_f2(path, file_id):
331
331
            return path == 'f2'
332
 
        d.show(out, short_status=True, filter=only_f2)
 
332
        _mod_delta.report_delta(out, d, short_status=True, filter=only_f2)
333
333
        self.assertEquals("A  f2\n", out.getvalue())
334
334
 
335
335
    def test_delta_show_long_status_single_file_filter(self):
337
337
        out = StringIO()
338
338
        def only_f2(path, file_id):
339
339
            return path == 'f2'
340
 
        d.show(out, short_status=False, filter=only_f2)
 
340
        _mod_delta.report_delta(out, d, short_status=False, filter=only_f2)
341
341
        self.assertEquals("added:\n  f2\n", out.getvalue())
342
342
 
343
343
    def test_delta_show_short_status_single_file_id_filter(self):
345
345
        out = StringIO()
346
346
        def only_f2_id(path, file_id):
347
347
            return file_id == 'f2-id'
348
 
        d.show(out, short_status=True, filter=only_f2_id)
 
348
        _mod_delta.report_delta(out, d, short_status=True, filter=only_f2_id)
349
349
        self.assertEquals("A  f2\n", out.getvalue())
350
350