~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_delta.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2007-2010, 2016 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
321
321
        d, long_status, short_status = self._get_delta()
322
322
        out = StringIO()
323
323
        _mod_delta.report_delta(out, d, short_status=True)
324
 
        self.assertEquals(short_status, out.getvalue())
 
324
        self.assertEqual(short_status, out.getvalue())
325
325
 
326
326
    def test_delta_show_long_status_no_filter(self):
327
327
        d, long_status, short_status = self._get_delta()
328
328
        out = StringIO()
329
329
        _mod_delta.report_delta(out, d, short_status=False)
330
 
        self.assertEquals(long_status, out.getvalue())
 
330
        self.assertEqual(long_status, out.getvalue())
331
331
 
332
332
    def test_delta_show_no_filter(self):
333
333
        d, long_status, short_status = self._get_delta()
335
335
        def not_a_filter(path, file_id):
336
336
            return True
337
337
        _mod_delta.report_delta(out, d, short_status=True, filter=not_a_filter)
338
 
        self.assertEquals(short_status, out.getvalue())
 
338
        self.assertEqual(short_status, out.getvalue())
339
339
 
340
340
    def test_delta_show_short_status_single_file_filter(self):
341
341
        d, long_status, short_status = self._get_delta()
343
343
        def only_f2(path, file_id):
344
344
            return path == 'f2'
345
345
        _mod_delta.report_delta(out, d, short_status=True, filter=only_f2)
346
 
        self.assertEquals("A  f2\n", out.getvalue())
 
346
        self.assertEqual("A  f2\n", out.getvalue())
347
347
 
348
348
    def test_delta_show_long_status_single_file_filter(self):
349
349
        d, long_status, short_status = self._get_delta()
351
351
        def only_f2(path, file_id):
352
352
            return path == 'f2'
353
353
        _mod_delta.report_delta(out, d, short_status=False, filter=only_f2)
354
 
        self.assertEquals("added:\n  f2\n", out.getvalue())
 
354
        self.assertEqual("added:\n  f2\n", out.getvalue())
355
355
 
356
356
    def test_delta_show_short_status_single_file_id_filter(self):
357
357
        d, long_status, short_status = self._get_delta()
359
359
        def only_f2_id(path, file_id):
360
360
            return file_id == 'f2-id'
361
361
        _mod_delta.report_delta(out, d, short_status=True, filter=only_f2_id)
362
 
        self.assertEquals("A  f2\n", out.getvalue())
 
362
        self.assertEqual("A  f2\n", out.getvalue())
363
363